Commit 960da8b
Add public StringUtilities.getChars(String) for fast char[] access
New public API returns a ThreadLocal char[] populated via String.getChars()
(SIMD bulk copy). Callers replace str.charAt(i) with buf[i] to avoid
per-character method call and JDK 9+ coder check overhead.
hashCodeIgnoreCase now uses this public method. Any hot loop across
java-util, json-io, or downstream projects can benefit with:
char[] buf = StringUtilities.getChars(str);
for (int i = 0; i < str.length(); i++) { buf[i] ... }
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 94c27c2 commit 960da8b
2 files changed
Lines changed: 28 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 26 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
| 977 | + | |
982 | 978 | | |
983 | 979 | | |
984 | 980 | | |
| |||
996 | 992 | | |
997 | 993 | | |
998 | 994 | | |
999 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1000 | 1020 | | |
1001 | 1021 | | |
1002 | 1022 | | |
| |||
0 commit comments