Commit 3d727ca
authored
uucore: parse_time: avoid expensive
The conversion routine used to parse the time into a BigDecimal and normalize it into nanoseconds; however, for an input like 1e6666666666668320 it would require allocating a number with 6666666666668329 zeroes, which is obviously suboptimal (and redundant, as `Duration` uses `u64` for seconds).
Fixes #8634.with_scale(9) for huge inputs1 parent 7dbeb8f commit 3d727ca
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
0 commit comments