]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Css: Fix bits operations
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 15:31:36 +0000 (16:31 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 15:31:36 +0000 (16:31 +0100)
src/libserver/css/css_rule.cxx

index 02f33aa13e3a3a654fc804bfbb087f7fc43a0b95..417770a08c5b42165793248400cad377d62f2726 100644 (file)
@@ -56,7 +56,7 @@ void css_rule::override_values(const css_rule &other)
        /* Copy only not set values */
        std::copy_if(other.values.begin(), other.values.end(), std::back_inserter(values),
                        [&bits](const auto &elt) -> bool {
-                               return !isset(&bits, static_cast<int>(elt.type));
+                               return (bits & static_cast<int>(elt.type)) == 0;
                        });
 }
 
@@ -74,8 +74,8 @@ void css_rule::merge_values(const css_rule &other)
        /* Copy only not set values */
        std::copy_if(other.values.begin(), other.values.end(), std::back_inserter(values),
                        [&bits](const auto &elt) -> bool {
-               return !isset(&bits, static_cast<int>(elt.type));
-       });
+                               return (bits & static_cast<int>(elt.type)) == 0;
+                       });
 }
 
 auto css_declarations_block::add_rule(rule_shared_ptr rule) -> bool