1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Enable the no-else-return ESLint rule

Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
This commit is contained in:
Jonas Jenwald 2016-12-16 13:05:33 +01:00
parent 049d7fa277
commit 4046d67fde
19 changed files with 67 additions and 79 deletions

View file

@ -280,12 +280,14 @@ function approximateFraction(x) {
a = p; b = q;
}
}
var result;
// Select closest of the neighbours to x.
if (x_ - a / b < c / d - x_) {
return x_ === x ? [a, b] : [b, a];
result = x_ === x ? [a, b] : [b, a];
} else {
return x_ === x ? [c, d] : [d, c];
result = x_ === x ? [c, d] : [d, c];
}
return result;
}
function roundToDivide(x, div) {