本文整理匯總了Golang中code/google/com/p/codesearch/sparse.Set.Dense方法的典型用法代碼示例。如果您正苦於以下問題:Golang Set.Dense方法的具體用法?Golang Set.Dense怎麽用?Golang Set.Dense使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code/google/com/p/codesearch/sparse.Set
的用法示例。
在下文中一共展示了Set.Dense方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: stepByte
// stepByte steps runq to nextq consuming c and then expanding according to flag.
// It returns true if a match ends immediately before c.
// c is either an input byte or endText.
func (m *matcher) stepByte(runq, nextq *sparse.Set, c int, flag syntax.EmptyOp) (match bool) {
nextq.Reset()
m.addq(nextq, uint32(m.prog.Start), flag)
for _, id := range runq.Dense() {
i := &m.prog.Inst[id]
switch i.Op {
default:
continue
case syntax.InstMatch:
match = true
continue
case instByteRange:
if c == endText {
break
}
lo := int((i.Arg >> 8) & 0xFF)
hi := int(i.Arg & 0xFF)
ch := c
if i.Arg&argFold != 0 && 'a' <= ch && ch <= 'z' {
ch += 'A' - 'a'
}
if lo <= ch && ch <= hi {
m.addq(nextq, i.Out, flag)
}
}
}
return
}
示例2: stepEmpty
// stepEmpty steps runq to nextq expanding according to flag.
func (m *matcher) stepEmpty(runq, nextq *sparse.Set, flag syntax.EmptyOp) {
nextq.Reset()
for _, id := range runq.Dense() {
m.addq(nextq, id, flag)
}
}