From b733e149bb606d57499115e90318b00c6fe19bc3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 25 Apr 2013 14:41:10 +0200 Subject: remove unnecessary table indexing --- otfl-font-nms.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'otfl-font-nms.lua') diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 50febab..b5c954d 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -154,6 +154,9 @@ function names.resolve(specification) elseif subfamily == "regular" or table.contains(synonyms.regular, subfamily) then found.fallback = face + elseif name = fullname then + found[1] = face + break end else if name == fullname @@ -357,9 +360,7 @@ local function load_font(filename, fontnames, newfontnames, texmf) return end local index = newstatus[basefile].index[i] - if newstatus[basefile].index[i] then - index = newstatus[basefile].index[i] - else + if not index then index = #newmappings+1 end newmappings[index] = fullinfo -- cgit v1.2.3 From 3a2b6eac9022524baab2d52ce9ba4aef819bd574 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 25 Apr 2013 14:54:07 +0200 Subject: remove another indexing duplication --- otfl-font-nms.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'otfl-font-nms.lua') diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index b5c954d..1f01693 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -371,10 +371,8 @@ local function load_font(filename, fontnames, newfontnames, texmf) if not fullinfo then return end - local index - if newstatus[basefile].index[1] then - index = newstatus[basefile].index[1] - else + local index = newstatus[basefile].index[1] + if not index then index = #newmappings+1 end newmappings[index] = fullinfo -- cgit v1.2.3