From f5a0d81c52261b8df9741b33a6abca1c5c8a0a01 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 1 Aug 2024 12:37:57 -0700 Subject: [PATCH] Remove some redundant branches I think they were getting optimized out, but still --- ConflictSet.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 095e37f..1b3ba60 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -939,6 +939,9 @@ template int getChildGeqSimd(NodeT *self, int child) { } return -1; } + if (child > 255) { + return -1; + } #ifdef HAS_AVX __m128i key_vec = _mm_set1_epi8(child); @@ -996,28 +999,12 @@ template int getChildGeqSimd(NodeT *self, int child) { #endif } -int getChildGeq(Node0 *, int child) { - if (child > 255) { - return -1; - } - return -1; -} -int getChildGeq(Node3 *self, int child) { - if (child > 255) { - return -1; - } - return getChildGeqSimd(self, child); -} +int getChildGeq(Node0 *, int) { return -1; } +int getChildGeq(Node3 *self, int child) { return getChildGeqSimd(self, child); } int getChildGeq(Node16 *self, int child) { - if (child > 255) { - return -1; - } return getChildGeqSimd(self, child); } int getChildGeq(Node48 *self, int child) { - if (child > 255) { - return -1; - } return self->bitSet.firstSetGeq(child); } int getChildGeq(Node256 *self, int child) {