From 7105951698c9a052f5bfad25a93c80728ae5e9e6 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 4 Apr 2010 16:00:05 +0200 Subject: |table.insert()| is slower The difference is negligible, but this make the code more consistent. --- otfl-font-nms.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 23207b8..c057c07 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -265,7 +265,7 @@ local function load_font(filename, fontnames, status, newfontnames, newstatus, t if db_timestamp == timestamp then for _,v in ipairs(status[filename].index) do mappings[#mappings+1] = oldmappings[v] - table.insert(newstatus[filename].index, #mappings) + newstatus[filename].index[#newstatus[filename].index+1] = #mappings end if trace_loading then logs.report("font already indexed: %s", filename) @@ -281,12 +281,12 @@ local function load_font(filename, fontnames, status, newfontnames, newstatus, t for i in ipairs(info) do local fullinfo = font_fullinfo(filename, i-1, texmf) mappings[#mappings+1] = fullinfo - table.insert(newstatus[filename].index, #mappings) + newstatus[filename].index[#newstatus[filename].index+1] = #mappings end else local fullinfo = font_fullinfo(filename, nil, texmf) mappings[#mappings+1] = fullinfo - table.insert(newstatus[filename].index, #mappings) + newstatus[filename].index[#newstatus[filename].index+1] = #mappings end else if trace_loading then -- cgit v1.2.3