[Pkg-javascript-commits] [pdf.js] 42/139: remove null checks that always evaluate to false
David Prévot
taffit at moszumanska.debian.org
Fri Jan 9 21:18:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit ea719ae805a032505074c01c70d12e951c633aad
Author: fkaelberer <l_l at gmx-topmail.de>
Date: Thu Oct 30 09:18:52 2014 +0100
remove null checks that always evaluate to false
---
src/core/jpg.js | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/core/jpg.js b/src/core/jpg.js
index 9aa0e81..330987f 100644
--- a/src/core/jpg.js
+++ b/src/core/jpg.js
@@ -130,9 +130,8 @@ var JpegImage = (function jpegImage() {
function decodeHuffman(tree) {
var node = tree;
- var bit;
- while ((bit = readBit()) !== null) {
- node = node[bit];
+ while (true) {
+ node = node[readBit()];
if (typeof node === 'number') {
return node;
}
@@ -140,17 +139,12 @@ var JpegImage = (function jpegImage() {
throw 'invalid huffman sequence';
}
}
- return null;
}
function receive(length) {
var n = 0;
while (length > 0) {
- var bit = readBit();
- if (bit === null) {
- return;
- }
- n = (n << 1) | bit;
+ n = (n << 1) | readBit();
length--;
}
return n;
@@ -866,8 +860,7 @@ var JpegImage = (function jpegImage() {
}
}
- // decodeTransform will contains pairs of multiplier (-256..256) and
- // additive
+ // decodeTransform contains pairs of multiplier (-256..256) and additive
var transform = this.decodeTransform;
if (transform) {
for (i = 0; i < dataLength;) {
--
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