3
0
Fork 0
forked from mirrors/nixpkgs

lib/strings: simplify removePrefix readability

It was discussed as a part of #2570.
This commit is contained in:
Vladimír Čunát 2014-05-08 13:07:02 +02:00
parent 5bbcebf2db
commit 180bd65cd0

View file

@ -155,8 +155,8 @@ rec {
preLen = stringLength pre; preLen = stringLength pre;
sLen = stringLength s; sLen = stringLength s;
in in
if pre == substring 0 preLen s then if hasPrefix pre s then
substring preLen (sub sLen preLen) s substring preLen (sLen - preLen) s
else else
s; s;