[Pkg-javascript-commits] [pdf.js] 208/246: Ignore setGState no-ops.
David Prévot
taffit at moszumanska.debian.org
Sun Sep 7 15:36:41 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 9674abc542603a0c6b38420e98b11c35ae2ba0f2
Author: Nicholas Nethercote <nnethercote at mozilla.com>
Date: Thu Aug 14 20:34:53 2014 -0700
Ignore setGState no-ops.
For the document in #2504, 11% of the ops are `setGState` with a
`gStateObj` that is an empty array, which is a no-op. This is possible
because we ignore various setGState keys (OP, OPM, BG, etc).
This change prevents these ops from being inserted into the operator
list.
---
src/core/evaluator.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index 603f248..adb6562 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -412,7 +412,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
break;
// Only generate info log messages for the following since
- // they are unlikey to have a big impact on the rendering.
+ // they are unlikely to have a big impact on the rendering.
case 'OP':
case 'op':
case 'OPM':
@@ -446,7 +446,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
setGStateForKey(gStateObj, key, value);
}
return promise.then(function () {
- operatorList.addOp(OPS.setGState, [gStateObj]);
+ if (gStateObj.length >= 0) {
+ operatorList.addOp(OPS.setGState, [gStateObj]);
+ }
});
},
--
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