Merge pull request #195 from varadharajan/fix-hash-size

Allocate 82 bytes instead of 62 bytes in LevelDB's CreateKeyFor method
This commit is contained in:
Barak Michener 2015-02-03 18:46:03 -05:00
commit b878c69969

View file

@ -150,7 +150,7 @@ func hashOf(s string) []byte {
} }
func (qs *QuadStore) createKeyFor(d [4]quad.Direction, q quad.Quad) []byte { func (qs *QuadStore) createKeyFor(d [4]quad.Direction, q quad.Quad) []byte {
key := make([]byte, 0, 2+(hashSize*3)) key := make([]byte, 0, 2+(hashSize*4))
// TODO(kortschak) Remove dependence on String() method. // TODO(kortschak) Remove dependence on String() method.
key = append(key, []byte{d[0].Prefix(), d[1].Prefix()}...) key = append(key, []byte{d[0].Prefix(), d[1].Prefix()}...)
key = append(key, hashOf(q.Get(d[0]))...) key = append(key, hashOf(q.Get(d[0]))...)