mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
8 times faster matching of enter key within incoming pty data
https://jsperf.com/exec-vs-match-vs-test-vs-search/5
This commit is contained in:
parent
75b37b7690
commit
fe6e2977bd
1 changed files with 1 additions and 2 deletions
|
|
@ -54,8 +54,7 @@ export function addSessionData(uid, data) {
|
|||
data,
|
||||
effect() {
|
||||
const {shell} = getState().sessions.sessions[uid];
|
||||
|
||||
const enterKey = Boolean(data.match(/\n/));
|
||||
const enterKey = data.indexOf('\n') > 0;
|
||||
const url = enterKey ? isUrl(shell, data) : null;
|
||||
if (url) {
|
||||
dispatch({
|
||||
|
|
|
|||
Loading…
Reference in a new issue