mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
lib.generators.toGitINI: move escape logic outside of hot loop
This commit is contained in:
@@ -394,11 +394,10 @@ rec {
|
||||
''${head sections} "${concatStringsSep "." (tail sections)}"'';
|
||||
|
||||
mkValueString =
|
||||
v:
|
||||
let
|
||||
escapedV = ''"${replaceStrings [ "\n" " " ''"'' "\\" ] [ "\\n" "\\t" ''\"'' "\\\\" ] v}"'';
|
||||
escape = replaceStrings [ "\n" " " ''"'' "\\" ] [ "\\n" "\\t" ''\"'' "\\\\" ];
|
||||
in
|
||||
mkValueStringDefault { } (if isString v then escapedV else v);
|
||||
v: mkValueStringDefault { } (if isString v then ''"${escape v}"'' else v);
|
||||
|
||||
# generation for multiple ini values
|
||||
mkKeyValue =
|
||||
|
||||
Reference in New Issue
Block a user