mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
Avoid a call to VersionedMap::ViewAtVersion::lower_bound (#6606)
* Avoid a call to VersionedMap::ViewAtVersion::lower_bound in some cases * Avoid lower_bound in both cases
This commit is contained in:
parent
6f57935eb4
commit
d39b881045
@ -2469,7 +2469,17 @@ ACTOR Future<GetKeyValuesReply> readRange(StorageServer* data,
|
||||
else
|
||||
readBegin = range.begin;
|
||||
|
||||
vCurrent = view.lower_bound(readBegin);
|
||||
if (vCurrent) {
|
||||
// We can get first greater or equal from the result of lastLessOrEqual
|
||||
if (vCurrent.key() != readBegin) {
|
||||
++vCurrent;
|
||||
}
|
||||
} else {
|
||||
// There's nothing less than or equal to readBegin in view, so
|
||||
// begin() is the first thing greater than readBegin, or end().
|
||||
// Either way that's the correct result for lower_bound.
|
||||
vCurrent = view.begin();
|
||||
}
|
||||
|
||||
while (limit > 0 && *pLimitBytes > 0 && readBegin < range.end) {
|
||||
ASSERT(!vCurrent || vCurrent.key() >= readBegin);
|
||||
|
Loading…
x
Reference in New Issue
Block a user