This repository was archived by the owner on Mar 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ func New(size int, numHashFuncs int) *BloomFilter {
5353
5454 // Create hash functions
5555 for i := 0 ; i < numHashFuncs ; i ++ {
56- seed := uint32 (i )
56+ seed := uint32 (i ) // Seed for the hash function
5757 hashFuncs [i ] = func (data []byte ) uint32 {
5858 return murmur .Hash32 (data , seed ) // Return the hash value
5959 }
@@ -168,7 +168,7 @@ func Deserialize(data []byte) (*BloomFilter, error) {
168168 if err := binary .Read (buf , binary .LittleEndian , & bitArraySize ); err != nil {
169169 return nil , err
170170 }
171- if bitArraySize < 0 || bitArraySize > 1 << 20 { // Add reasonable limit
171+ if bitArraySize < 0 || bitArraySize > 1 << 20 { // Check if the bit array size is valid
172172 return nil , errors .New ("invalid bit array size" )
173173 }
174174 bf .bitArray = make ([]bool , bitArraySize )
Original file line number Diff line number Diff line change @@ -1986,7 +1986,7 @@ func (it *Iterator) Next() ([]byte, []byte) {
19861986 return key , value
19871987 }
19881988 } else {
1989- it .sstIterIndex --
1989+ it .sstIterIndex -- // If we have no more keys in the sstable we move to the next sstable
19901990 }
19911991 }
19921992
@@ -2045,7 +2045,7 @@ func (it *Iterator) Prev() ([]byte, []byte) {
20452045 return key , value
20462046 }
20472047 } else {
2048- it .sstIterIndex ++
2048+ it .sstIterIndex ++ // If we have no more keys in the sstable we move to the next sstable
20492049
20502050 }
20512051 }
You can’t perform that action at this time.
0 commit comments