Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 1565bb8

Browse files
authored
Remove dead code (#122)
1 parent 31cd221 commit 1565bb8

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [21.1.0]
11+
12+
### Removed
13+
14+
- Some dead code has been deleted.
15+
1016
## [20.0.0]
1117

1218
### Changed

src/Decimal.mts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { Rational } from "./Rational.mjs";
22

3-
const ratOne = new Rational(1n, 1n);
4-
const ratTen = new Rational(10n, 1n);
5-
63
function _cohort(s: string): "0" | "-0" | Rational {
74
if (s.match(/^-/)) {
85
let c = _cohort(s.substring(1));
@@ -46,7 +43,7 @@ function _quantum(s: string): number {
4643
}
4744

4845
if (s.match(/[eE]/)) {
49-
let [dec, exp] = s.split(/[eE]/);
46+
let [_, exp] = s.split(/[eE]/);
5047
return parseInt(exp);
5148
}
5249

src/Decimal128.mts

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ function pickQuantum(
5353
return EXPONENT_MAX;
5454
}
5555

56+
if (d === "0" || d === "-0") {
57+
return preferredQuantum;
58+
}
59+
5660
return preferredQuantum;
5761
}
5862

0 commit comments

Comments
 (0)