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:
Jonas Jenwald 2026-05-25 16:14:15 +02:00 committed by GitHub
commit f156b8190b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 11 deletions

View File

@ -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) {

View File

@ -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];
}
/**