diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-12-31 00:58:34 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-12-31 01:33:47 +0100 |
commit | d103811173b7b608b2639af61d422736bf715a8e (patch) | |
tree | 53ee94186445c78573b785eef0a10f8e836924fa /lib | |
parent | d0d0f7d0aaf1ea29f6fe269340186de12d697dea (diff) |
lib.isStringLike: Remove use of list
In the current implementation of Nix, this list would be allocated
over and over. Iirc pennae tried to optimize static list allocation,
but gained no significant performance improvement.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/strings.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index db89f60c480c..2188fcb1dbfd 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -18,6 +18,7 @@ rec { isInt isList isAttrs + isPath isString match parseDrvName @@ -821,7 +822,8 @@ rec { string interpolations and in most functions that expect a string. */ isStringLike = x: - elem (typeOf x) [ "path" "string" ] || + isString x || + isPath x || x ? outPath || x ? __toString; |