mirror of https://github.com/zulip/zulip.git
composebox_typeahead: Remove unnecessary string operation.
slice always returns a new string, so this could have been motivated by ensuring we always duplicate the string, but reading the code, it's already sliced by the caller.
This commit is contained in:
parent
f617008924
commit
2e67cf38b3
|
@ -328,7 +328,7 @@ exports.tokenize_compose_str = function (s) {
|
|||
case '~':
|
||||
// Code block must start on a new line
|
||||
if (i === 2) {
|
||||
return s.slice(0);
|
||||
return s;
|
||||
} else if (i > 2 && s[i - 3] === "\n") {
|
||||
return s.slice(i - 2);
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ exports.tokenize_compose_str = function (s) {
|
|||
case ':':
|
||||
case '_':
|
||||
if (i === 0) {
|
||||
return s.slice(i);
|
||||
return s;
|
||||
} else if (/[\s(){}\[\]]/.test(s[i - 1])) {
|
||||
return s.slice(i);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue