diff options
| author | Shulhan <m.shulhan@gmail.com> | 2022-08-26 21:48:21 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2026-04-14 21:51:40 +0700 |
| commit | 91176a429dea9ca0c5724c45aa07f053de01c7c6 (patch) | |
| tree | 20aba0253a4fc8db98c1dcbcffd413e39fdec674 /src/net/http/internal/httpsfv | |
| parent | 8c0027ca7bde882aaa063044ac7c64ba5c7a6c92 (diff) | |
| download | go-91176a429dea9ca0c5724c45aa07f053de01c7c6.tar.xz | |
encoding/json: optimize isValidNumber function
Instead of re-slicing the string for checking the value, use single
index variable.
Benchmark result,
name old time/op new time/op delta
NumberIsValid-8 19.0ns ± 0% 14.5ns ± 1% -23.70% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
NumberIsValid-8 0.00B 0.00B ~ (all equal)
name old allocs/op new allocs/op delta
NumberIsValid-8 0.00 0.00 ~ (all equal)
Change-Id: I4698c5db134998f83ff47fb3add6a04ba6ec3aa0
Diffstat (limited to 'src/net/http/internal/httpsfv')
0 files changed, 0 insertions, 0 deletions
