From f1ad68109a430a7ad96fb12bafcfb1e925f4a20f Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 2 Aug 2024 17:01:19 -0700 Subject: [PATCH] Skip lcp call in SearchStepWise if no partial key --- ConflictSet.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 8f44754..6c260a2 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1777,10 +1777,13 @@ struct SearchStepWise { if (child == nullptr) { return true; } - int cl = std::min(child->partialKeyLen, remaining.size() - 1); - int i = longestCommonPrefix(child->partialKey(), remaining.data() + 1, cl); - if (i != child->partialKeyLen) { - return true; + if (child->partialKeyLen > 0) { + int cl = std::min(child->partialKeyLen, remaining.size() - 1); + int i = + longestCommonPrefix(child->partialKey(), remaining.data() + 1, cl); + if (i != child->partialKeyLen) { + return true; + } } n = child; remaining =