From: notmasteryet Date: Sat, 10 Dec 2011 00:25:44 +0000 (-0600) Subject: Using 'in' instead of array index X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=240bde97b2dc0e03ff388c160f69b9185822ae1a;p=pdf.js.git Using 'in' instead of array index --- diff --git a/src/fonts.js b/src/fonts.js index fa2c0a7..45a2afb 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -1779,7 +1779,7 @@ var Font = (function Font() { var usedUnicodes = [], unassignedUnicodeItems = []; for (var i = 0, ii = glyphs.length; i < ii; i++) { var unicode = toUnicode[i + 1]; - if (!unicode || usedUnicodes[unicode]) { + if (!unicode || unicode in usedUnicodes) { unassignedUnicodeItems.push(i); continue; } @@ -1789,7 +1789,7 @@ var Font = (function Font() { var unusedUnicode = kCmapGlyphOffset; for (var j = 0, jj = unassignedUnicodeItems.length; j < jj; j++) { var i = unassignedUnicodeItems[j]; - while (usedUnicodes[unusedUnicode]) + while (unusedUnicode in usedUnicodes) unusedUnicode++; glyphs[i].unicode = unusedUnicode++; }