Skip to content

Commit b082219

Browse files
authored
Remove unused code and functions (project-chip#37213)
1 parent ddf6e2f commit b082219

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

src/lib/support/verhoeff/Verhoeff.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,6 @@
2424

2525
#include "Verhoeff.h"
2626

27-
int Verhoeff::DihedralMultiply(int x, int y, int n)
28-
{
29-
int n2 = n * 2;
30-
31-
x = x % n2;
32-
y = y % n2;
33-
34-
if (x < n)
35-
{
36-
if (y < n)
37-
return (x + y) % n;
38-
39-
return ((x + (y - n)) % n) + n;
40-
}
41-
42-
if (y < n)
43-
return ((n + (x - n) - y) % n) + n;
44-
45-
return (n + (x - n) - (y - n)) % n;
46-
}
47-
4827
int Verhoeff::DihedralInvert(int val, int n)
4928
{
5029
if (val > 0 && val < n)

src/lib/support/verhoeff/Verhoeff.h

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class DLL_EXPORT Verhoeff10
7575
class Verhoeff
7676
{
7777
public:
78-
static int DihedralMultiply(int x, int y, int n);
7978
static int DihedralInvert(int val, int n);
8079
static int Permute(int val, const uint8_t * permTable, int permTableLen, uint64_t iterCount);
8180
};

src/lib/support/verhoeff/Verhoeff10.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#ifndef VERHOEFF10_NO_MULTIPLY_TABLE
32-
3331
const uint8_t Verhoeff10::sMultiplyTable[] = {
3432
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,
3533
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,
3634
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,
3735
};
3836

39-
#endif
40-
4137
const uint8_t Verhoeff10::sPermTable[] = { 1, 5, 7, 6, 2, 8, 3, 0, 9, 4 };
4238

4339
char Verhoeff10::ComputeCheckChar(const char * str)
@@ -59,11 +55,7 @@ char Verhoeff10::ComputeCheckChar(const char * str, size_t strLen)
5955

6056
int p = Verhoeff::Permute(val, sPermTable, Base, i);
6157

62-
#ifdef VERHOEFF10_NO_MULTIPLY_TABLE
63-
c = Verhoeff::DihedralMultiply(c, p, PolygonSize);
64-
#else
6558
c = sMultiplyTable[c * Base + p];
66-
#endif
6759
}
6860

6961
c = Verhoeff::DihedralInvert(c, PolygonSize);

0 commit comments

Comments
 (0)