lib.strings.makeSearchPath: use concatMap rather than map and filter

This commit is contained in:
Eman Resu
2026-05-15 23:11:45 -04:00
parent ec879e646e
commit 25604d3e68
+5 -1
View File
@@ -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