From ba87f89be2320b7ef8f74fa92242d4fb23b737a7 Mon Sep 17 00:00:00 2001 From: Ryoji Kurosawa Date: Sat, 18 May 2024 10:20:32 +0900 Subject: [PATCH] remove unnecessary loop in gc --- include/garbage_collection.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/garbage_collection.h b/include/garbage_collection.h index ca166d3..23e8e73 100644 --- a/include/garbage_collection.h +++ b/include/garbage_collection.h @@ -33,7 +33,7 @@ class garbage_collection { while (!node_container_.empty()) { std::tuple elem; - while (!node_container_.try_pop(elem)) continue; + if (!node_container_.try_pop(elem)) { continue; } delete std::get(elem); // NOLINT } @@ -48,7 +48,7 @@ class garbage_collection { while (!value_container_.empty()) { std::tuple elem; - while (!value_container_.try_pop(elem)) continue; + if (!value_container_.try_pop(elem)) { continue; } ::operator delete(std::get(elem), std::get(elem), std::get(elem)); @@ -87,7 +87,7 @@ class garbage_collection { // for container while (!node_container_.empty()) { std::tuple elem; - while (!node_container_.try_pop(elem)) continue; + if (!node_container_.try_pop(elem)) { continue; } if (std::get(elem) >= gc_epoch) { cache_node_container_ = elem; return; @@ -156,4 +156,4 @@ class garbage_collection { value_container_; // NOLINT }; -} // namespace yakushima \ No newline at end of file +} // namespace yakushima