From 8109046222d024323f9bdc50e048834ed4c06aab Mon Sep 17 00:00:00 2001 From: leipeng Date: Tue, 29 Oct 2024 11:04:20 -0700 Subject: [PATCH] secondary instance: remove unnessisary cfds_changed->count() (#13086) Summary: `cfds_changed->count(cfd)` is not needed, just blind insert. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13086 Reviewed By: hx235 Differential Revision: D64712400 Pulled By: cbi42 fbshipit-source-id: 4ef62aaa724c8397baa4ff350c16a7a8d04d7067 --- db/db_impl/db_impl_secondary.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index 93ac5c38c..d333b70d4 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -247,9 +247,7 @@ Status DBImplSecondary::RecoverLogFiles( if (cfd == nullptr) { continue; } - if (cfds_changed->count(cfd) == 0) { - cfds_changed->insert(cfd); - } + cfds_changed->insert(cfd); const std::vector& l0_files = cfd->current()->storage_info()->LevelFiles(0); SequenceNumber seq =