diff --git a/src/base/flags.hh b/src/base/flags.hh index 6e8221004a..0544380f1d 100644 --- a/src/base/flags.hh +++ b/src/base/flags.hh @@ -135,7 +135,7 @@ class Flags * @param mask Mask used to determine which bits are replaced. */ void - update(Type flags, Type mask) + replace(Type flags, Type mask) { _flags = (_flags & ~mask) | (flags & mask); } diff --git a/src/base/flags.test.cc b/src/base/flags.test.cc index c45a7a89dc..08031b9b73 100644 --- a/src/base/flags.test.cc +++ b/src/base/flags.test.cc @@ -192,11 +192,11 @@ TEST(FlagsTest, ConditionalSet) } /** - * Test updating a masked selection of bits. This means that bits of the + * Test replacing a masked selection of bits. This means that bits of the * original value that match the mask will be replaced by the bits of * the new value that match the mask. */ -TEST(FlagsTest, UpdateOverlapping) +TEST(FlagsTest, ReplaceOverlapping) { const uint32_t value_a = (1 << 4) | (1 << 5) | (1 << 6); const uint32_t value_b = (1 << 3) | (1 << 5) | (1 << 9); @@ -207,6 +207,6 @@ TEST(FlagsTest, UpdateOverlapping) // (1 << 10) is not set in both values, so it remains not set const uint32_t result = (1 << 5) | (1 << 6) | (1 << 9); Flags flags(value_a); - flags.update(value_b, mask); + flags.replace(value_b, mask); ASSERT_EQ(result, uint32_t(flags)); }