From 37b513a7600bb013d546016716fd37edd13fe492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 3 Jan 2025 21:23:51 +0100 Subject: [PATCH] TOOLS/file2string: use array of tuples to avoid unpacking strings --- TOOLS/file2string.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TOOLS/file2string.py b/TOOLS/file2string.py index 93efcc0ee6..3e7add18b0 100755 --- a/TOOLS/file2string.py +++ b/TOOLS/file2string.py @@ -35,7 +35,7 @@ def file2string(infilename, infile, outfile): for c in safe_chars: conv[ord(c)] = c - for c, esc in ("\nn", "\tt", r"\\", '""'): + for c, esc in [("\n", "n"), ("\t", "t"), ("\\", "\\"), ('"', '"')]: conv[ord(c)] = "\\" + esc for line in infile: outfile.write('"' + "".join(conv[c] for c in line) + '"\n')