From: Vsevolod Stakhov Date: Thu, 6 May 2021 15:31:36 +0000 (+0100) Subject: [Minor] Css: Fix bits operations X-Git-Tag: 3.0~428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8381b141d52546897af76c0798ec5bda654a6104;p=thirdparty%2Frspamd.git [Minor] Css: Fix bits operations --- diff --git a/src/libserver/css/css_rule.cxx b/src/libserver/css/css_rule.cxx index 02f33aa13e..417770a08c 100644 --- a/src/libserver/css/css_rule.cxx +++ b/src/libserver/css/css_rule.cxx @@ -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(elt.type)); + return (bits & static_cast(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(elt.type)); - }); + return (bits & static_cast(elt.type)) == 0; + }); } auto css_declarations_block::add_rule(rule_shared_ptr rule) -> bool