[Pkg-javascript-commits] [pdf.js] 168/207: A few small optimizations of adjustMapping

David Prévot taffit at moszumanska.debian.org
Mon Jul 28 15:36:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit c5f4051a75f2f6d00c2c2fd5d0e03821f5aa3013
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Jun 26 00:03:36 2014 +0200

    A few small optimizations of adjustMapping
    
    Replace a couple of |in| checks with comparisons against undefined.
---
 src/core/fonts.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index 64f680e..0293b6e 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -2483,7 +2483,7 @@ var Font = (function FontClosure() {
       var fontCharCode = originalCharCode;
       // First try to map the value to a unicode position if a non identity map
       // was created.
-      if (!isIdentityUnicode && originalCharCode in toUnicode) {
+      if (!isIdentityUnicode && toUnicode[originalCharCode] !== undefined) {
         var unicode = toUnicode[fontCharCode];
         // TODO: Try to map ligatures to the correct spot.
         if (unicode.length === 1) {
@@ -2496,7 +2496,7 @@ var Font = (function FontClosure() {
       // font was symbolic and there is only an identity unicode map since the
       // characters probably aren't in the correct position (fixes an issue
       // with firefox and thuluthfont).
-      if ((fontCharCode in usedFontCharCodes ||
+      if ((usedFontCharCodes[fontCharCode] !== undefined ||
            fontCharCode <= 0x1f || // Control chars
            fontCharCode === 0x7F || // Control char
            fontCharCode === 0xAD || // Soft hyphen
@@ -2514,7 +2514,7 @@ var Font = (function FontClosure() {
             nextAvailableFontCharCode = fontCharCode + 1;
           }
 
-        } while (fontCharCode in usedFontCharCodes &&
+        } while (usedFontCharCodes[fontCharCode] !== undefined &&
                  nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END);
       }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list