Commit 77e9fe3
committed
chore: early exit when encoding invalid numbers
Before this change, we checked the validity of every number during
encoding. Now, we stop if we find an invalid one.
In my testing, this was about twice as fast for invalid inputs. It had
no performance impact for valid inputs, but should theoretically avoid
an unnecessary array allocation.1 parent ebca95e commit 77e9fe3
4 files changed
+9
-7
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
632 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
633 | 635 | | |
634 | 636 | | |
635 | 637 | | |
| |||
0 commit comments