From e409cea4435608ad6d53ebffe6a06f34142b1fa7 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 9 Sep 2023 02:17:11 +0300 Subject: cache the value in simple value streams * analyzing the bytecode via tostream(...):jdump() has shown that this might be more efficient --- applause.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applause.lua b/applause.lua index 20bce20..96beada 100644 --- a/applause.lua +++ b/applause.lua @@ -188,8 +188,10 @@ Stream.channels = 1 -- A stream, produces an infinite number of the same value by default -- (eternal quietness by default) function Stream:gtick() + local value = self.value + return function() - return self.value + return value end end -- cgit v1.2.3