summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lcs.c b/lcs.c
index b971c79..f3a6203 100644
--- a/lcs.c
+++ b/lcs.c
@@ -158,7 +158,7 @@ int lcs_32_rough(unsigned char *str1, unsigned char *str2) {
#endif
#ifdef USE_PRE_LCS
-//efine DO_SECOND_SUM
+#define DO_SECOND_SUM
#ifdef DO_SECOND_SUM
#include "arpa/inet.h"
@@ -188,7 +188,9 @@ int lcs_upper_bound(const uint32_t * const str1_int, const uint32_t * const str2
// can be off up to two nibbles (e.g., "0110" and "1122")
ret = first_sum * 2 + 2;
#ifdef DO_SECOND_SUM
- if (ret >= MSF) {
+ // We can only increase our accuracy by 1, so do second_sum only if we can
+ // turn a false-positive into a negative
+ if (ret == MSF) {
uint32_t bo_str2_int[4];
uint32_t shifted_str2_int[4];
const unsigned char * const str2_r = (const unsigned char * const)shifted_str2_int;