From e85d73c02f0ffc77b96d146f2b8a8e1c99f00602 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 14 Jul 2020 00:50:05 -0400 Subject: [PATCH] is_alphanumeric more efficient --- src/CMakeLists.txt | 5 +---- src/meson.build | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91d59a28..33a41b75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,6 @@ if(WIN32) - set(is_abs " -if (scan('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', path(1:1)) > 0 .and. & - path(2:2) == ':') is_absolute_path = .true. -") + set(is_abs "if (lge(path(1:1), 'A' .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.") else() set(is_abs "if(path(1:1) == '/') is_absolute_path=.true.") endif() diff --git a/src/meson.build b/src/meson.build index ee141226..875831bd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,10 +1,7 @@ conf_data = configuration_data() if os == 'windows' - code = ''' - if (scan('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', path(1:1)) > 0 .and. & - path(2:2) == ':') is_absolute_path = .true. -''' + code = '''if (lge(path(1:1), 'A') .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.''' else code = '''if(path(1:1) == '/') is_absolute_path=.true.''' endif