aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2019-04-17 17:46:06 +0900
committerDevine Lu Linvega <[email protected]>2019-04-17 17:46:06 +0900
commit7c5121ef86ffad17afdb741f9c0ac621ef08b84d (patch)
treebacff933459d8da9389fe6a3e6e07a7c487b8f3a
parentb1ede29786e3950d6ead2453eb9f66a43d8d5d37 (diff)
downloadOrca-7c5121ef86ffad17afdb741f9c0ac621ef08b84d.tar.gz
Orca-7c5121ef86ffad17afdb741f9c0ac621ef08b84d.zip
Minor optimisation
-rw-r--r--desktop/sources/scripts/commander.js5
-rw-r--r--desktop/sources/scripts/patterns.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js
index 37d38c2..b64dce4 100644
--- a/desktop/sources/scripts/commander.js
+++ b/desktop/sources/scripts/commander.js
@@ -84,8 +84,9 @@ function Commander (terminal) {
}
this.preview = function () {
- if (!this.patterns.find(this.query)) { terminal.cursor.reset(); return }
- const result = this.patterns.find(this.query).trim().split('\n')
+ const pattern = this.patterns.find(this.query)
+ if (!pattern) { terminal.cursor.reset(); return }
+ const result = pattern.trim().split('\n')
terminal.cursor.resize(result[0].length, result.length)
}
diff --git a/desktop/sources/scripts/patterns.js b/desktop/sources/scripts/patterns.js
index fe2a1a5..819f4bd 100644
--- a/desktop/sources/scripts/patterns.js
+++ b/desktop/sources/scripts/patterns.js
@@ -21,7 +21,7 @@ const Patterns = function (terminal) {
this.collection['dy'] = `D8\n.Y`
this.find = function (name) {
- // Basics
+ // Statics
if (this.collection[name]) {
return this.collection[name]
}