From e47410d56c667cda9f8070a929df7a955ce13115 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 29 May 2023 16:49:52 -0400 Subject: Framework-level query testing + fixes --- include/shard/WIRS.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/shard/WIRS.h') diff --git a/include/shard/WIRS.h b/include/shard/WIRS.h index 7e3f468..020df19 100644 --- a/include/shard/WIRS.h +++ b/include/shard/WIRS.h @@ -203,7 +203,7 @@ public: free_tree(m_root); } - Wrapped *point_lookup(R &rec, bool filter=false) { + Wrapped *point_lookup(const R &rec, bool filter=false) { if (filter && !m_bf->lookup(rec.key)) { return nullptr; } @@ -213,9 +213,9 @@ public: return nullptr; } - while (idx < m_reccnt && m_data[idx] < rec) ++idx; + while (idx < m_reccnt && m_data[idx].rec < rec) ++idx; - if (m_data[idx] == rec) { + if (m_data[idx].rec == rec) { return m_data + idx; } @@ -254,7 +254,7 @@ private: while (min < max) { size_t mid = (min + max) / 2; - if (key > m_data[mid].key) { + if (key > m_data[mid].rec.key) { min = mid + 1; } else { max = mid; -- cgit v1.2.3