Skip to content

Commit e85d73c

Browse files
committed
is_alphanumeric more efficient
1 parent dbc0926 commit e85d73c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11

22
if(WIN32)
3-
set(is_abs "
4-
if (scan('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', path(1:1)) > 0 .and. &
5-
path(2:2) == ':') is_absolute_path = .true.
6-
")
3+
set(is_abs "if (lge(path(1:1), 'A' .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.")
74
else()
85
set(is_abs "if(path(1:1) == '/') is_absolute_path=.true.")
96
endif()

src/meson.build

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
conf_data = configuration_data()
22

33
if os == 'windows'
4-
code = '''
5-
if (scan('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', path(1:1)) > 0 .and. &
6-
path(2:2) == ':') is_absolute_path = .true.
7-
'''
4+
code = '''if (lge(path(1:1), 'A') .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.'''
85
else
96
code = '''if(path(1:1) == '/') is_absolute_path=.true.'''
107
endif

0 commit comments

Comments
 (0)