Improve the efficiency of stringToCharacters.
svn path=/nixpkgs/trunk/; revision=17671
This commit is contained in:
parent
915fa6a08f
commit
088e6995a2
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ rec {
|
|||
stringToCharacters = s: let l = stringLength s; in
|
||||
if l == 0
|
||||
then []
|
||||
else [(substring 0 1 s)] ++ stringToCharacters (substring 1 (builtins.sub l 1) s);
|
||||
else map (p: substring p 1 s) (lib.range 0 (sub l 1));
|
||||
|
||||
|
||||
# Manipulate a string charcater by character and replace them by strings
|
||||
|
|
Loading…
Reference in a new issue