This repository was archived by the owner on Apr 6, 2021. It is now read-only.
Commit 59bb1d8
committed
fix future sort order bug
When sorting based on the BigInt values, we are doing `Number(a - z)`,
but if the result of `a - z` is bigger then the max number, then
overflows would happen. This will result in a hard-to-debug bug.
This is a prevention for the future, because currently all our `a - z`
values will not reach Number.MAX_SAFE_INTEGER mark (9007199254740991).1 parent 57fd486 commit 59bb1d8
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| |||
261 | 273 | | |
262 | 274 | | |
263 | 275 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 276 | + | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
| |||
1132 | 1142 | | |
1133 | 1143 | | |
1134 | 1144 | | |
1135 | | - | |
| 1145 | + | |
1136 | 1146 | | |
1137 | 1147 | | |
1138 | 1148 | | |
| |||
0 commit comments