Share search of common prefix
All checks were successful
Tests / Release [gcc] total: 363, passed: 363
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/14//gcc">weaselab » conflict-set » main #14</a>
Tests / Coverage total: 361, passed: 361
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Release [gcc] total: 363, passed: 363
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/14//gcc">weaselab » conflict-set » main #14</a>
Tests / Coverage total: 361, passed: 361
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -1061,6 +1061,31 @@ bool checkRangeRead(Node *n, std::span<const uint8_t> begin,
|
|||||||
int lcp = longestCommonPrefix(begin.data(), end.data(),
|
int lcp = longestCommonPrefix(begin.data(), end.data(),
|
||||||
std::min(begin.size(), end.size()));
|
std::min(begin.size(), end.size()));
|
||||||
|
|
||||||
|
SearchStepWise search{n, begin.subspan(0, lcp)};
|
||||||
|
Arena arena;
|
||||||
|
for (;;) {
|
||||||
|
assert(getSearchPath(arena, search.n) <=>
|
||||||
|
begin.subspan(0, lcp - search.remaining.size()) ==
|
||||||
|
0);
|
||||||
|
if (search.n->maxVersion <= readVersion) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (search.step()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(getSearchPath(arena, search.n) <=>
|
||||||
|
begin.subspan(0, lcp - search.remaining.size()) ==
|
||||||
|
0);
|
||||||
|
|
||||||
|
const int consumed = lcp - search.remaining.size();
|
||||||
|
assert(consumed >= 0);
|
||||||
|
|
||||||
|
begin = begin.subspan(consumed, int(begin.size()) - consumed);
|
||||||
|
end = end.subspan(consumed, int(end.size()) - consumed);
|
||||||
|
n = search.n;
|
||||||
|
lcp -= consumed;
|
||||||
|
|
||||||
if (lcp == int(begin.size())) {
|
if (lcp == int(begin.size())) {
|
||||||
for (int i = lcp; i < int(end.size()); ++i) {
|
for (int i = lcp; i < int(end.size()); ++i) {
|
||||||
if (!checkPointRead(n, end.subspan(0, i), readVersion)) {
|
if (!checkPointRead(n, end.subspan(0, i), readVersion)) {
|
||||||
|
Reference in New Issue
Block a user