From b082219e3bc47137b5ca99b66d83200952d63903 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Tue, 28 Jan 2025 02:43:54 -0600 Subject: [PATCH] Remove unused code and functions (#37213) --- src/lib/support/verhoeff/Verhoeff.cpp | 21 --------------------- src/lib/support/verhoeff/Verhoeff.h | 1 - src/lib/support/verhoeff/Verhoeff10.cpp | 8 -------- 3 files changed, 30 deletions(-) diff --git a/src/lib/support/verhoeff/Verhoeff.cpp b/src/lib/support/verhoeff/Verhoeff.cpp index 90f6869e75cb40..bc0117dea8f08a 100644 --- a/src/lib/support/verhoeff/Verhoeff.cpp +++ b/src/lib/support/verhoeff/Verhoeff.cpp @@ -24,27 +24,6 @@ #include "Verhoeff.h" -int Verhoeff::DihedralMultiply(int x, int y, int n) -{ - int n2 = n * 2; - - x = x % n2; - y = y % n2; - - if (x < n) - { - if (y < n) - return (x + y) % n; - - return ((x + (y - n)) % n) + n; - } - - if (y < n) - return ((n + (x - n) - y) % n) + n; - - return (n + (x - n) - (y - n)) % n; -} - int Verhoeff::DihedralInvert(int val, int n) { if (val > 0 && val < n) diff --git a/src/lib/support/verhoeff/Verhoeff.h b/src/lib/support/verhoeff/Verhoeff.h index eca266e3ff3cd4..ae24bc85771a14 100644 --- a/src/lib/support/verhoeff/Verhoeff.h +++ b/src/lib/support/verhoeff/Verhoeff.h @@ -75,7 +75,6 @@ class DLL_EXPORT Verhoeff10 class Verhoeff { public: - static int DihedralMultiply(int x, int y, int n); static int DihedralInvert(int val, int n); static int Permute(int val, const uint8_t * permTable, int permTableLen, uint64_t iterCount); }; diff --git a/src/lib/support/verhoeff/Verhoeff10.cpp b/src/lib/support/verhoeff/Verhoeff10.cpp index dd025a28cdabb9..3e45352dfec53c 100644 --- a/src/lib/support/verhoeff/Verhoeff10.cpp +++ b/src/lib/support/verhoeff/Verhoeff10.cpp @@ -28,16 +28,12 @@ #include #include -#ifndef VERHOEFF10_NO_MULTIPLY_TABLE - const uint8_t Verhoeff10::sMultiplyTable[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 0, 6, 7, 8, 9, 5, 2, 3, 4, 0, 1, 7, 8, 9, 5, 6, 3, 4, 0, 1, 2, 8, 9, 5, 6, 7, 4, 0, 1, 2, 3, 9, 5, 6, 7, 8, 5, 9, 8, 7, 6, 0, 4, 3, 2, 1, 6, 5, 9, 8, 7, 1, 0, 4, 3, 2, 7, 6, 5, 9, 8, 2, 1, 0, 4, 3, 8, 7, 6, 5, 9, 3, 2, 1, 0, 4, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, }; -#endif - const uint8_t Verhoeff10::sPermTable[] = { 1, 5, 7, 6, 2, 8, 3, 0, 9, 4 }; char Verhoeff10::ComputeCheckChar(const char * str) @@ -59,11 +55,7 @@ char Verhoeff10::ComputeCheckChar(const char * str, size_t strLen) int p = Verhoeff::Permute(val, sPermTable, Base, i); -#ifdef VERHOEFF10_NO_MULTIPLY_TABLE - c = Verhoeff::DihedralMultiply(c, p, PolygonSize); -#else c = sMultiplyTable[c * Base + p]; -#endif } c = Verhoeff::DihedralInvert(c, PolygonSize);