by Ricardo “Rudxain” Fernández Serrata
Version 2 (March 20, 2023)
Download (118 downloads)
More efficient in time, space, and energy.
The fork-block is only used for responsiveness (because get-setting and "toast" have latency, that could prevent content-changed from detecting an update), you can use a simple loop if you don't need too much responsiveness.
`s[0][3] & 3` exists because dictionaries are expensive, so I tried to find something that allows optimization, and noticed that the 4th char of all categories at the rightmost (least significant) bits, matches their IDs (`system` is `0b00`, `secure` is `0b01`, `global` is `0b10`). I used `& 3` instead of `% 4` because of a benchmark I did on my device where "modulo" was slower than "bit and". Bitwise ops require 2-way float-int conversions, but they seem faster than division.
Original: llamalab.com/automate/community/flows/7409
5 stars | 1 | |
4 stars | 1 | |
3 stars | 0 | |
2 stars | 0 | |
1 star | 0 | |
Reports | 0 |
Rate and review within the app in the Community section.