[m-rev.] diff: use list.take_while_not/4 in a few spots
Julien Fischer
jfischer at opturion.com
Tue Dec 13 21:14:43 AEDT 2022
Use list.take_while_not/4 in a few spots.
library/dir.m:
As above.
Julien.
diff --git a/library/dir.m b/library/dir.m
index 5a4044e..b42916a 100644
--- a/library/dir.m
+++ b/library/dir.m
@@ -338,7 +338,6 @@
:- import_module io.file.
:- import_module maybe.
:- import_module require.
-:- import_module std_util.
:- import_module string.
:- import_module unit.
@@ -448,7 +447,7 @@ split_name_3(FileNameChars, DirName, BaseName) :-
RevFileNameChars = RevFileNameChars0
),
( if
- list.take_while(isnt(dir.is_directory_separator_semidet),
+ list.take_while_not(dir.is_directory_separator_semidet,
RevFileNameChars, RevBaseName, RevDirName0),
RevBaseName = [_ | _],
RevDirName0 = [_ | _]
@@ -734,7 +733,7 @@ strip_leading_win32_current_drive_root_directory([Char1 | !.FileName],
strip_leading_win32_unc_root_directory([Sep, Sep | !.FileName], !:FileName) :-
dir.is_directory_separator(Sep),
- list.take_while(isnt(dir.is_directory_separator_semidet), !.FileName,
+ list.take_while_not(dir.is_directory_separator_semidet, !.FileName,
Server, !:FileName),
Server = [_ | _],
(
@@ -745,7 +744,7 @@ strip_leading_win32_unc_root_directory([Sep, Sep | !.FileName], !:FileName) :-
!.FileName = []
;
!.FileName = [_ | _],
- list.take_while(isnt(dir.is_directory_separator_semidet),
+ list.take_while_not(dir.is_directory_separator_semidet,
!.FileName, Share, !:FileName),
Share = [_ | _],
( !.FileName = [Sep | !:FileName]
More information about the reviews
mailing list