forked from mirrors/nixpkgs
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.
This commit is contained in:
parent
d0d0f7d0aa
commit
d103811173
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue