Skip to content
Snippets Groups Projects
Commit c9eba240 authored by Alexander Rose's avatar Alexander Rose
Browse files

use const

parent 75cc5769
Branches
Tags
No related merge requests found
...@@ -21,7 +21,7 @@ export function parseInt(str: string, start: number, end: number) { ...@@ -21,7 +21,7 @@ export function parseInt(str: string, start: number, end: number) {
let ret = 0, neg = 1; let ret = 0, neg = 1;
if (str.charCodeAt(start) === 45 /* - */) { neg = -1; start++; } if (str.charCodeAt(start) === 45 /* - */) { neg = -1; start++; }
for (; start < end; start++) { for (; start < end; start++) {
let c = str.charCodeAt(start) - 48; const c = str.charCodeAt(start) - 48;
if (c > 9 || c < 0) return (neg * ret) | 0; if (c > 9 || c < 0) return (neg * ret) | 0;
else ret = (10 * ret + c) | 0; else ret = (10 * ret + c) | 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment