mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -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,
|
data,
|
||||||
effect() {
|
effect() {
|
||||||
const {shell} = getState().sessions.sessions[uid];
|
const {shell} = getState().sessions.sessions[uid];
|
||||||
|
const enterKey = data.indexOf('\n') > 0;
|
||||||
const enterKey = Boolean(data.match(/\n/));
|
|
||||||
const url = enterKey ? isUrl(shell, data) : null;
|
const url = enterKey ? isUrl(shell, data) : null;
|
||||||
if (url) {
|
if (url) {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue