From b56e6a453b9fdb3f7fbd1c20c86dcdf7ae773d1a Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Sun, 28 Oct 2018 17:41:27 +0000 Subject: [PATCH] Simplify string.format() copies --- l3kernel/l3luatex.dtx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/l3kernel/l3luatex.dtx b/l3kernel/l3luatex.dtx index a5e2b797ff..7a0f66b380 100644 --- a/l3kernel/l3luatex.dtx +++ b/l3kernel/l3luatex.dtx @@ -340,7 +340,6 @@ local open = io.open local os_clock = os.clock local os_date = os.date local setcatcode = tex.setcatcode -local str_format = string.format local sprint = tex.sprint local write = tex.write local utf8_char = unicode.utf8.char @@ -449,16 +448,16 @@ local function filemoddate(name) else local hours = floor(off / 60) local mins = abs(off - hours * 60) - timezone = str_format("%+03d", hours) - .. "'" .. str_format("%02d", mins) .. "'" + timezone = format("%+03d", hours) + .. "'" .. format("%02d", mins) .. "'" end write("D:" - .. str_format("%04d", d.year) - .. str_format("%02d", d.month) - .. str_format("%02d", d.day) - .. str_format("%02d", d.hour) - .. str_format("%02d", d.min) - .. str_format("%02d", d.sec) + .. format("%04d", d.year) + .. format("%02d", d.month) + .. format("%02d", d.day) + .. format("%02d", d.hour) + .. format("%02d", d.min) + .. format("%02d", d.sec) .. timezone) end end