Commit d0083b1
committed
Speed up boolean-token fallback in StringArray.getAsDouble
Replace the toLowerCase plus equals chain in the parse fallback with a
length-based dispatch: a single char compare for the 1-char "t"/"f"
tokens and compareToIgnoreCase for "true"/"false", matching the idiom
already used in DoubleArray.parseDouble. This avoids allocating a
lower-cased copy and rejects non-boolean strings immediately.
Restore throwing DMLRuntimeException on unparseable input. The previous
re-throw of the raw NumberFormatException changed the exception type and
broke callers such as Array.extractDouble that expect DMLRuntimeException;
the throw path is the genuinely-exceptional case, so the wrapping cost is
irrelevant there.1 parent 6b4e2fb commit d0083b1
1 file changed
Lines changed: 14 additions & 6 deletions
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
614 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
615 | 625 | | |
616 | | - | |
| 626 | + | |
617 | 627 | | |
618 | | - | |
619 | | - | |
620 | | - | |
| 628 | + | |
621 | 629 | | |
622 | 630 | | |
623 | 631 | | |
| |||
0 commit comments