lib.strings.makeSearchPath: use concatMap rather than map and filter
This commit is contained in:
+5
-1
@@ -16,6 +16,7 @@ rec {
|
||||
|
||||
inherit (builtins)
|
||||
compareVersions
|
||||
concatMap
|
||||
elem
|
||||
elemAt
|
||||
filter
|
||||
@@ -564,7 +565,10 @@ rec {
|
||||
:::
|
||||
*/
|
||||
makeSearchPath =
|
||||
subDir: paths: concatStringsSep ":" (map (path: path + "/" + subDir) (filter (x: x != null) paths));
|
||||
subDir: paths:
|
||||
concatStringsSep ":" (
|
||||
concatMap (path: if path != null then [ (path + "/" + subDir) ] else [ ]) paths
|
||||
);
|
||||
|
||||
/**
|
||||
Construct a Unix-style search path by appending the given
|
||||
|
||||
Reference in New Issue
Block a user