]> gitweb.factorcode.org Git - factor.git/commitdiff
lcd: reduce performance impact of the previous fix
authorAlexander Ilin <alex.ilin@protonmail.com>
Wed, 16 Aug 2023 23:43:02 +0000 (01:43 +0200)
committerAlexander Ilin <alex.ilin@protonmail.com>
Wed, 16 Aug 2023 23:48:13 +0000 (01:48 +0200)
Only add the extra space once when the window is created. Keep the lcd word
output clean.

extra/lcd/lcd.factor

index 712ed3c3ccc367e3996b3153dec57ca0cddd7a6f..c556936b9e40af90819fd7c02b5c4a8e34bb4a44 100644 (file)
@@ -16,12 +16,12 @@ IN: lcd
     '[ _ lcd-digit ] { } map-as concat ;
 
 : lcd ( digit-str -- string )
-    4 <iota> [ lcd-row ] with map join-lines " " append ;
+    4 <iota> [ lcd-row ] with map join-lines ;
 
 TUPLE: time-display < label timer ;
 
 : <time-display> ( -- gadget )
-    "99:99:99" lcd time-display new-label
+    "99:99:99" lcd " " append time-display new-label
         monospace-font >>font
         dup '[ now timestamp>hms lcd _ string<< ]
         f 1 seconds <timer> >>timer ;