Experiment with sync.Pool

This commit is contained in:
kortschak 2014-08-14 19:03:55 +09:30
parent 6d609f191a
commit 737037a894
2 changed files with 32 additions and 27 deletions

View file

@ -185,13 +185,13 @@ func (it *Iterator) Contains(v graph.Value) bool {
case quad.Subject:
offset = 0
case quad.Predicate:
offset = (it.qs.hasherSize * 2)
offset = (hashSize * 2)
case quad.Object:
offset = (it.qs.hasherSize * 2) * 2
offset = (hashSize * 2) * 2
case quad.Label:
offset = (it.qs.hasherSize * 2) * 3
offset = (hashSize * 2) * 3
}
val := v.(string)[offset : it.qs.hasherSize*2+offset]
val := v.(string)[offset : hashSize*2+offset]
if val == it.hash {
it.result = v
return graph.ContainsLogOut(it, v, true)