summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/internal/utils/skip.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/utils/skip.go')
-rw-r--r--vendor/github.com/bytedance/sonic/internal/utils/skip.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/utils/skip.go b/vendor/github.com/bytedance/sonic/internal/utils/skip.go
index e42bfe759..1ae77195b 100644
--- a/vendor/github.com/bytedance/sonic/internal/utils/skip.go
+++ b/vendor/github.com/bytedance/sonic/internal/utils/skip.go
@@ -76,4 +76,12 @@ func SkipNumber(src string, pos int) (ret int) {
runtime.KeepAlive(src)
return int(uintptr(sp) - uintptr((*rt.GoString)(unsafe.Pointer(&src)).Ptr))
-} \ No newline at end of file
+}
+
+// Hack: this is used for both checking space and cause friendly compile errors in 32-bit arch.
+const _Sonic_Not_Support_32Bit_Arch__Checking_32Bit_Arch_Here = (1 << ' ') | (1 << '\t') | (1 << '\r') | (1 << '\n')
+
+
+func IsSpace(c byte) bool {
+ return (int(1<<c) & _Sonic_Not_Support_32Bit_Arch__Checking_32Bit_Arch_Here) != 0
+}