[libcxx-commits] [PATCH] D100828: Remove if-else to make branch predictor happy
Marek Kurdej via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 20 02:37:45 PDT 2021
curdeius added inline comments.
================
Comment at: libcxx/include/bitset:778
_CharT __c = __str[_Mp - 1 - __i];
if (__c == __zero)
(*this)[__i] = false;
----------------
When here, please update this part too.
================
Comment at: libcxx/include/bitset:806
_CharT __c = __str[__pos + _Mp - 1 - __i];
- if (_Traits::eq(__c, __zero))
- (*this)[__i] = false;
- else
- (*this)[__i] = true;
+ (*this)[__i] = _Traits::eq(__c, __one);
}
----------------
I assume that there's no subtle difference between `_Traits::eq(__c, __one)` and `!_Traits::eq(__c, __zero)`, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100828/new/
https://reviews.llvm.org/D100828
More information about the libcxx-commits
mailing list