« get me outta code hell

(perf) Make sizeProp not a getter - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/form
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-08-05 13:10:21 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-05 13:10:21 -0300
commit2b1f0b65f1f0eee5a5d621e92e7b64142df0734b (patch)
tree5b2eb1aba89b3ce95710ade6b37f72e789b7e695 /ui/form
parent07a667058b9f1ae12e07222b3058d0e2500dd3dc (diff)
(perf) Make sizeProp not a getter
Diffstat (limited to 'ui/form')
-rw-r--r--ui/form/ListScrollForm.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/form/ListScrollForm.js b/ui/form/ListScrollForm.js
index 77699c2..300fed4 100644
--- a/ui/form/ListScrollForm.js
+++ b/ui/form/ListScrollForm.js
@@ -39,6 +39,8 @@ module.exports = class ListScrollForm extends Form {
     // posProp) the next element should be.
     let nextPos = 0
 
+    this.sizeProp = this.getSizeProp()
+
     for (const item of itemsPastScroll) {
       item.fixLayout()
 
@@ -160,7 +162,7 @@ module.exports = class ListScrollForm extends Form {
       .reduce((a, b) => a + b[this.sizeProp], 0)
   }
 
-  get sizeProp() {
+  getSizeProp() {
     // The property used to measure the size of an item. If the layoutType
     // isn't valid (that is, 'horizontal' or 'vertical'), it'll return null.