提交 90ace5d4 编写于 作者: A Alex Dima

fixes #115

上级 e5d7c7a9
...@@ -40,15 +40,15 @@ export class LineStream implements IStream { ...@@ -40,15 +40,15 @@ export class LineStream implements IStream {
} }
private actualStringToArray(str:string):boolean[] { private actualStringToArray(str:string):boolean[] {
var maxCharCode = 0; let maxCharCode = 0;
for (var i = 0; i < str.length; i++) { for (let i = 0; i < str.length; i++) {
maxCharCode = str.charCodeAt(i); maxCharCode = Math.max(maxCharCode, str.charCodeAt(i));
} }
var r = []; let r:boolean[] = [];
for (i = 0; i < maxCharCode; i++) { for (let i = 0; i <= maxCharCode; i++) {
r[i] = false; r[i] = false;
} }
for (i = 0; i < str.length; i++) { for (let i = 0; i < str.length; i++) {
r[str.charCodeAt(i)] = true; r[str.charCodeAt(i)] = true;
} }
return r; return r;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册