]> git.parisson.com Git - pdf.js.git/commitdiff
Using 'in' instead of array index
authornotmasteryet <async.processingjs@yahoo.com>
Sat, 10 Dec 2011 00:25:44 +0000 (18:25 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Sat, 10 Dec 2011 00:25:44 +0000 (18:25 -0600)
src/fonts.js

index fa2c0a7f13d285c8573ac96e6856c106f813407a..45a2afb99effdc18365d18bf717683f68dc2f94a 100644 (file)
@@ -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++;
             }