From 4507363571d3eae34ed75f48e76b4d3981801291 Mon Sep 17 00:00:00 2001 From: ScottPJones Date: Sat, 21 Oct 2023 13:46:18 -0400 Subject: [PATCH] Improve performance of is_alphanumeric --- .github/workflows/ci.yml | 2 +- Project.toml | 2 +- src/unicode.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36c5c31..70b34ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,8 @@ jobs: fail-fast: false matrix: version: - - '1.5' - '1.6' + - '1.9' - 'nightly' os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index fa7eb82..495e4bd 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["Characters"] license = "MIT" desc = "Basic functionality for Chr type" authors = ["ScottPJones "] -version = "1.0.3" +version = "1.0.4" [deps] Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/src/unicode.jl b/src/unicode.jl index 13bade1..358a3d1 100644 --- a/src/unicode.jl +++ b/src/unicode.jl @@ -82,7 +82,7 @@ const _isnumeric_a = _isdigit @inline _ispunct_l(ch) = ((UInt64(1) << (ch-0x80)) & 0x88c0_0882_0000_0000) != 0 @inline _isspace_l(ch) = (ch == 0x85) | (ch == 0xa0) @inline _isalpha_l(ch) = ((0xff7f_ffff_ff7f_ffff_0420_0400_0000_0000 >>> (ch-0x80)) & 1) != 0 -@inline _isalnum_l(ch) = _isalpha_l(ch) || _isnumeric_l(ch) +@inline _isalnum_l(ch) = ((0xff7f_ffff_ff7f_ffff_762c_0400_0000_0000 >>> (ch-0x80)) & 1) != 0 @inline _isprint_l(ch) = ((0xa0 <= ch <= 0xff) & (ch != 0xad)) @inline _isgraph_l(ch) = ((0xa0 < ch <= 0xff) & (ch != 0xad))