summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-05-06 09:40:11 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2024-05-06 09:40:11 -0400
commitfeeba1de8d9774e32007686627a6a5633dff2559 (patch)
tree96ddaacb986e03f4a6fd55e24b16b4d210f80a8a /include
parent675cf7f7558ebaef15f398d90cc3d1d91457b219 (diff)
downloaddynamic-extension-feeba1de8d9774e32007686627a6a5633dff2559.tar.gz
Missing file from last commit
Diffstat (limited to 'include')
-rw-r--r--include/shard/TrieSpline.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/shard/TrieSpline.h b/include/shard/TrieSpline.h
index 3ae72f8..581277e 100644
--- a/include/shard/TrieSpline.h
+++ b/include/shard/TrieSpline.h
@@ -117,7 +117,7 @@ public:
m_reccnt = info.record_count;
m_tombstone_cnt = info.tombstone_count;
- if (m_reccnt > 0) {
+ if (m_reccnt > 50) {
m_ts = bldr.Finalize();
}
}
@@ -217,7 +217,7 @@ public:
m_reccnt = info.record_count;
m_tombstone_cnt = info.tombstone_count;
- if (m_reccnt > 0) {
+ if (m_reccnt > 50) {
m_ts = bldr.Finalize();
}
}
@@ -273,6 +273,18 @@ public:
}
size_t get_lower_bound(const K& key) const {
+ if (m_reccnt < 50) {
+ size_t bd = m_reccnt;
+ for (size_t i=0; i<m_reccnt; i++) {
+ if (m_data[i].rec.key >= key) {
+ bd = i;
+ break;
+ }
+ }
+
+ return bd;
+ }
+
auto bound = m_ts.GetSearchBound(key);
size_t idx = bound.begin;