[src/core/fonts.js] Replace some unnecessary Stream.getUint16() calls with Stream.skip(2) instead

There's a handful of cases in the code where the intention is simply to advance the `Stream` position, but rather than only doing that the code instead fetches/computes a Uint16 value (and without using the result for anything).
This commit is contained in:
Jonas Jenwald 2020-04-19 10:29:26 +02:00
parent 4fae1ac5c4
commit 033d27fc25

View File

@ -1590,7 +1590,7 @@ var Font = (function FontClosure() {
var start = (file.start ? file.start : 0) + cmap.offset; var start = (file.start ? file.start : 0) + cmap.offset;
file.pos = start; file.pos = start;
file.getUint16(); // version file.skip(2); // version
var numTables = file.getUint16(); var numTables = file.getUint16();
var potentialTable; var potentialTable;
@ -1665,8 +1665,7 @@ var Font = (function FontClosure() {
} }
var format = file.getUint16(); var format = file.getUint16();
file.getUint16(); // length file.skip(2 + 2); // length + language
file.getUint16(); // language
var hasShortCmap = false; var hasShortCmap = false;
var mappings = []; var mappings = [];
@ -1695,7 +1694,7 @@ var Font = (function FontClosure() {
for (segIndex = 0; segIndex < segCount; segIndex++) { for (segIndex = 0; segIndex < segCount; segIndex++) {
segments.push({ end: file.getUint16() }); segments.push({ end: file.getUint16() });
} }
file.getUint16(); file.skip(2);
for (segIndex = 0; segIndex < segCount; segIndex++) { for (segIndex = 0; segIndex < segCount; segIndex++) {
segments[segIndex].start = file.getUint16(); segments[segIndex].start = file.getUint16();
} }