According to the key passed by Prefix, the key is equal to the key prefix in the iterator. If it is not equal, the next iteration is performed
()
| 62 | // the key is equal to the key prefix in the iterator. |
| 63 | // If it is not equal, the next iteration is performed |
| 64 | func (it *Iterator) skipToNext() { |
| 65 | prefixLen := len(it.options.Prefix) |
| 66 | if prefixLen == 0 { |
| 67 | return |
| 68 | } |
| 69 | |
| 70 | for ; it.indexIter.Valid(); it.indexIter.Next() { |
| 71 | key := it.indexIter.Key() |
| 72 | |
| 73 | // Check if the key has the desired prefix |
| 74 | if prefixLen <= len(key) && bytes.Equal(it.options.Prefix, key[:prefixLen]) { |
| 75 | break |
| 76 | } |
| 77 | } |
| 78 | } |