mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-30 10:57:21 +02:00
Avoid a temporary variable and return results directly in a couple of functions
This commit is contained in:
parent
164ffb9042
commit
48a12ac225
@ -37,13 +37,10 @@ function getFloat214(view, offset) {
|
|||||||
|
|
||||||
function getSubroutineBias(subrs) {
|
function getSubroutineBias(subrs) {
|
||||||
const numSubrs = subrs.length;
|
const numSubrs = subrs.length;
|
||||||
let bias = 32768;
|
if (numSubrs >= 33900) {
|
||||||
if (numSubrs < 1240) {
|
return 32768;
|
||||||
bias = 107;
|
|
||||||
} else if (numSubrs < 33900) {
|
|
||||||
bias = 1131;
|
|
||||||
}
|
}
|
||||||
return bias;
|
return numSubrs < 1240 ? 107 : 1131;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCmap(data, start, end) {
|
function parseCmap(data, start, end) {
|
||||||
|
|||||||
@ -266,14 +266,11 @@ function approximateFraction(x) {
|
|||||||
b = q;
|
b = q;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let result;
|
|
||||||
// Select closest of the neighbours to x.
|
// Select closest of the neighbours to x.
|
||||||
if (x_ - a / b < c / d - x_) {
|
if (x_ - a / b < c / d - x_) {
|
||||||
result = x_ === x ? [a, b] : [b, a];
|
return x_ === x ? [a, b] : [b, a];
|
||||||
} else {
|
|
||||||
result = x_ === x ? [c, d] : [d, c];
|
|
||||||
}
|
}
|
||||||
return result;
|
return x_ === x ? [c, d] : [d, c];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user