From a9ee3f2f7f557adbe5448e4f4fbf71c23fe808b1 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 7 Apr 2025 14:37:19 -0400 Subject: Implemented the legacy policies and fixed a few bugs --- include/framework/structure/InternalLevel.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'include/framework/structure/InternalLevel.h') diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h index 5659c72..54b3ae2 100644 --- a/include/framework/structure/InternalLevel.h +++ b/include/framework/structure/InternalLevel.h @@ -217,17 +217,11 @@ public: m_shards.push_back(shard); } - const ShardType *get_shard(ShardID shid) const { - if (shid < m_shards.size()) { - return m_shards[shid].first.get(); - } - - return nullptr; - } - - const shard_ptr get_shard_ptr(size_t shid) const { - if (shid < m_shards.size()) { - return m_shards[shid]; + const shard_ptr get_shard_ptr(ssize_t idx) const { + if (idx >= 0 && idx < (ssize_t) m_shards.size()) { + return m_shards[idx]; + } else if (idx == all_shards_idx && m_shards.size() == 1) { + return m_shards[0]; } return {nullptr, 0}; -- cgit v1.2.3