mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Simplify the sign
handling in the Lexer.getNumber
method
After the changes in PR 15606, we can (slightly) simplify the `sign` handling.
This commit is contained in:
parent
9a6f439dc7
commit
fe869aca38
1 changed files with 1 additions and 3 deletions
|
@ -893,7 +893,7 @@ class Lexer {
|
|||
let ch = this.currentChar;
|
||||
let eNotation = false;
|
||||
let divideBy = 0; // Different from 0 if it's a floating point value.
|
||||
let sign = 0;
|
||||
let sign = 1;
|
||||
|
||||
if (ch === /* '-' = */ 0x2d) {
|
||||
sign = -1;
|
||||
|
@ -904,7 +904,6 @@ class Lexer {
|
|||
ch = this.nextChar();
|
||||
}
|
||||
} else if (ch === /* '+' = */ 0x2b) {
|
||||
sign = 1;
|
||||
ch = this.nextChar();
|
||||
}
|
||||
if (ch === /* LF = */ 0x0a || ch === /* CR = */ 0x0d) {
|
||||
|
@ -929,7 +928,6 @@ class Lexer {
|
|||
throw new FormatError(msg);
|
||||
}
|
||||
|
||||
sign ||= 1;
|
||||
let baseValue = ch - 0x30; // '0'
|
||||
let powerValue = 0;
|
||||
let powerValueSign = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue