diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-09-09 02:17:11 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-09-09 02:17:11 +0300 |
commit | e409cea4435608ad6d53ebffe6a06f34142b1fa7 (patch) | |
tree | de8723cd05ca929b9ca2a30f6e316b994dd6d4d1 | |
parent | 5ff0b15bbed7fe25a50c49dc52f561738b45b09e (diff) | |
download | applause2-e409cea4435608ad6d53ebffe6a06f34142b1fa7.tar.gz |
cache the value in simple value streams
* analyzing the bytecode via tostream(...):jdump() has shown that this might be more efficient
-rw-r--r-- | applause.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |