Exemple #1
0
func (it *LlrbIterator) Check(v graph.TSVal) bool {
	graph.CheckLogIn(it, v)
	if it.tree.Has(Int64(v.(int64))) {
		it.Last = v
		return graph.CheckLogOut(it, v, true)
	}
	return graph.CheckLogOut(it, v, false)
}
Exemple #2
0
func (m *MongoIterator) Check(v graph.TSVal) bool {
	graph.CheckLogIn(m, v)
	if m.isAll {
		m.Last = v
		return graph.CheckLogOut(m, v, true)
	}
	var offset int
	switch m.dir {
	case "s":
		offset = 0
	case "p":
		offset = (m.ts.hasher.Size() * 2)
	case "o":
		offset = (m.ts.hasher.Size() * 2) * 2
	case "c":
		offset = (m.ts.hasher.Size() * 2) * 3
	}
	val := v.(string)[offset : m.ts.hasher.Size()*2+offset]
	if val == m.hash {
		m.Last = v
		return graph.CheckLogOut(m, v, true)
	}
	return graph.CheckLogOut(m, v, false)
}