mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
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 New Issue
Block a user