Skip to content
Snippets Groups Projects
Commit 60c8b999 authored by ilor's avatar ilor
Browse files

remove assert from add_values_masked to allow clearing an attribute

parent fc80fd1f
Branches
No related merge requests found
......@@ -92,8 +92,9 @@ public:
void add_values_masked(mask_t value, mask_t mask)
{
assert(mask & value);
values_ = (values_ & ~mask) | value;
//values_ = (values_ & ~mask) | (value & mask);
//see http://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
values_ = values_ ^ ((values_ ^ value) & mask);
}
Tag& combine_with(const Tag& other) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment