Enable constexpr on core::equals
This commit is contained in:
parent
e3c4ab65f1
commit
340120d920
|
@ -461,7 +461,7 @@ export namespace core {
|
||||||
* Tests the equality of `a` against `b`, returning `true` if they contain identical bytes,
|
* Tests the equality of `a` against `b`, returning `true` if they contain identical bytes,
|
||||||
* otherwise `false`.
|
* otherwise `false`.
|
||||||
*/
|
*/
|
||||||
bool equals(slice<u8 const> const & a, slice<u8 const> const & b) {
|
constexpr bool equals(slice<u8 const> const & a, slice<u8 const> const & b) {
|
||||||
if (a.length != b.length) return false;
|
if (a.length != b.length) return false;
|
||||||
|
|
||||||
for (size_t i = 0; i < a.length; i += 1) if (a[i] != b[i]) return false;
|
for (size_t i = 0; i < a.length; i += 1) if (a[i] != b[i]) return false;
|
||||||
|
|
Loading…
Reference in New Issue