mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
refactor(key) setCurrentByChar: for -> while
This commit is contained in:
parent
ca739bb5e0
commit
d82ea49e94
1 changed files with 8 additions and 7 deletions
|
|
@ -162,19 +162,20 @@ var CloudCmd, Util, DOM;
|
|||
}
|
||||
|
||||
function setCurrentByChar(char) {
|
||||
var i, n, name, isMatch, byName, firstByName,
|
||||
var name, isMatch, byName, firstByName,
|
||||
skipCount = 0,
|
||||
skipN = 0,
|
||||
setted = false,
|
||||
current = Info.element,
|
||||
files = Info.files,
|
||||
escapeChar = Util.escapeRegExp(char),
|
||||
regExp = new RegExp('^' + escapeChar + '.*$', 'i');
|
||||
|
||||
n = Chars.length;
|
||||
for (i = 0; i < n; i++)
|
||||
if (char !== Chars[i])
|
||||
break;
|
||||
regExp = new RegExp('^' + escapeChar + '.*$', 'i'),
|
||||
i = 0,
|
||||
n = Chars.length;
|
||||
|
||||
while(i < n && char === Chars[i]) {
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!i)
|
||||
Chars = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue