From 1eab9d616da1451d2a635c087e60df93e635c680 Mon Sep 17 00:00:00 2001 From: Jackson Owens Date: Fri, 12 Apr 2024 12:16:28 -0400 Subject: [PATCH] db: simplify levelIter skipEmptyFileForward Apply a small simplification to levelIter.skipEmptyFileForward's condition for when to interleave a synthetic boundary. Previously we needed to check whether a file's largest point key was a range deletion to work around getIter's use of the rangeDelIterPtr. Now that getIter no longer uses levelIter it's unnecessary. --- level_iter.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/level_iter.go b/level_iter.go index baf858e168..3a1d2d4135 100644 --- a/level_iter.go +++ b/level_iter.go @@ -993,12 +993,7 @@ func (l *levelIter) skipEmptyFileForward() *base.InternalKV { // tolerate this repeat key and in this case will keep the level at // the top of the heap and immediately skip the entry, advancing to // the next file. - // - // TODO(jackson): We should be able to condition this only on - // *l.rangeDelIterPtr != nil, but the getIter retains tombstones - // returned by the rangeDelIter after it's nil'd the ptr. - if l.iterFile.LargestPointKey.Kind() == InternalKeyKindRangeDelete || - *l.rangeDelIterPtr != nil { + if *l.rangeDelIterPtr != nil { l.syntheticBoundary = base.MakeInternalKV(l.iterFile.LargestPointKey, nil) l.largestBoundary = &l.syntheticBoundary if l.boundaryContext != nil {