From bb0022e2c014c5c07400a4eeb02721158d0c40be Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Wed, 3 Apr 2024 14:47:08 +0100 Subject: [PATCH] `base::EnumSet::Empty/Size` deleted These functions now match the case in std functions. Chromium change: https://chromium.googlesource.com/chromium/src/+/bda6288d5f00d7d00ae4b4274ef8743b6cbeb9cd commit bda6288d5f00d7d00ae4b4274ef8743b6cbeb9cd Author: Lei Zhang Date: Fri Mar 29 23:16:03 2024 +0000 Remove base::EnumSet::Empty() and Size() Replace with empty() and size(), respectively. The lowercase method names work better with templated code that expects classes to have size(), similar to STL containers. Fix a typo along the way. --- components/brave_sync/brave_sync_p3a.cc | 2 +- components/sync/service/brave_sync_service_impl_unittest.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/brave_sync/brave_sync_p3a.cc b/components/brave_sync/brave_sync_p3a.cc index 0804cf8a5f1..26683686b67 100644 --- a/components/brave_sync/brave_sync_p3a.cc +++ b/components/brave_sync/brave_sync_p3a.cc @@ -27,7 +27,7 @@ void RecordEnabledTypes(bool sync_everything_enabled, selected_types.HasAll(all_brave_supported_types)) { // Sync All sample = EnabledTypesAnswer::kAllTypes; - } else if (selected_types.Empty() || + } else if (selected_types.empty() || selected_types == UserSelectableTypeSet({UserSelectableType::kBookmarks})) { // Bookmarks or no types diff --git a/components/sync/service/brave_sync_service_impl_unittest.cc b/components/sync/service/brave_sync_service_impl_unittest.cc index e7f1a3379fa..c1c0f8a5e6f 100644 --- a/components/sync/service/brave_sync_service_impl_unittest.cc +++ b/components/sync/service/brave_sync_service_impl_unittest.cc @@ -592,7 +592,7 @@ TEST_F(BraveSyncServiceImplTest, OnlyBookmarksAfterSetup) { brave_sync_service_impl()->GetUserSettings()->IsSyncEverythingEnabled()); auto selected_types = brave_sync_service_impl()->GetUserSettings()->GetSelectedTypes(); - EXPECT_EQ(selected_types.Size(), 1u); + EXPECT_EQ(selected_types.size(), 1u); EXPECT_TRUE(selected_types.Has(UserSelectableType::kBookmarks)); OSCryptMocker::TearDown();