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