mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
lib/strings: simplify removePrefix readability
It was discussed as a part of #2570.
This commit is contained in:
parent
5bbcebf2db
commit
180bd65cd0
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue