Skip to content

Commit

Permalink
is_alphanumeric more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 14, 2020
1 parent dbc0926 commit e85d73c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
5 changes: 1 addition & 4 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e85d73c

Please sign in to comment.