pdf.js/src/core
Jonas Jenwald f5a617a334 Make the decodeHuffman function, in src/core/jpg.js, slightly more efficient
Rather than repeating the `typeof node` check twice, we can use a `switch` statement instead.

This patch was tested using the PDF file from issue 3809, i.e. https://web.archive.org/web/20140801150504/http://vs.twonky.dk/invitation.pdf, with the following manifest file:
```
[
    {  "id": "issue3809",
       "file": "../web/pdfs/issue3809.pdf",
       "md5": "",
       "rounds": 50,
       "type": "eq"
    }
]
```

which gave the following results when comparing this patch against the `master` branch:
```
-- Grouped By browser, stat --
browser | stat         | Count | Baseline(ms) | Current(ms) | +/- |    %  | Result(P<.05)
------- | ------------ | ----- | ------------ | ----------- | --- | ----- | -------------
Firefox | Overall      |    50 |        12537 |       12451 | -86 | -0.69 |        faster
Firefox | Page Request |    50 |            5 |           5 |   0 |  0.77 |
Firefox | Rendering    |    50 |        12532 |       12446 | -86 | -0.69 |        faster
```
2020-01-28 14:23:58 +01:00
..
annotation.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
arithmetic_decoder.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
bidi.js Enable the no-nested-ternary ESLint rule (PR 11488 follow-up) 2020-01-14 17:49:39 +01:00
ccitt_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
ccitt.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cff_parser.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
charsets.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
chunked_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cmap.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
colorspace.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
core_utils.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
crypto.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
document.js Merge pull request #11482 from Snuffleupagus/more-core-utils 2020-01-25 21:38:34 +01:00
encodings.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
evaluator.js Merge pull request #11515 from Snuffleupagus/cache-fallback-font 2020-01-25 21:32:28 +01:00
font_renderer.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
fonts.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
function.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
glyphlist.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
image_utils.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
image.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
jpeg_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jpg.js Make the decodeHuffman function, in src/core/jpg.js, slightly more efficient 2020-01-28 14:23:58 +01:00
jpx_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jpx.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
metrics.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
murmurhash3.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
obj.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
operator_list.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
pattern.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
pdf_manager.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
primitives.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
ps_parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
standard_fonts.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
stream.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
type1_parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
unicode.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
worker_stream.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
worker.js Ensure that full clean-up is always run when handling the "Terminate" message in src/core/worker.js 2020-01-16 15:11:56 +01:00