Skip to content

Commit

Permalink
cleanup: code uses modulo (#83)
Browse files Browse the repository at this point in the history
Co-authored-by: Jarrod Colburn <[email protected]>
  • Loading branch information
jarrodcolburn and Jarrod Colburn authored Mar 18, 2024
1 parent d98976a commit 03c379d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/src/math.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ final Uint8List _expTable = _createExpTable();

int glog(int n) => (n >= 1) ? _logTable[n] : throw ArgumentError('glog($n)');

int gexp(int n) {
while (n < 0) {
n += 255;
}

while (n >= 256) {
n -= 255;
}

return _expTable[n];
}
int gexp(int n) => _expTable[n % 255];

Uint8List _createExpTable() {
final list = Uint8List(256);
Expand Down

0 comments on commit 03c379d

Please sign in to comment.