mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03: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
|
isInt
|
||||||
isList
|
isList
|
||||||
isAttrs
|
isAttrs
|
||||||
|
isPath
|
||||||
isString
|
isString
|
||||||
match
|
match
|
||||||
parseDrvName
|
parseDrvName
|
||||||
@ -821,7 +822,8 @@ rec {
|
|||||||
string interpolations and in most functions that expect a string.
|
string interpolations and in most functions that expect a string.
|
||||||
*/
|
*/
|
||||||
isStringLike = x:
|
isStringLike = x:
|
||||||
elem (typeOf x) [ "path" "string" ] ||
|
isString x ||
|
||||||
|
isPath x ||
|
||||||
x ? outPath ||
|
x ? outPath ||
|
||||||
x ? __toString;
|
x ? __toString;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user