Closed dsidirop closed 1 month ago
Thanks for your suggestion, but I'll have to decline it.
I already thought about this myself and have decided to keep it as a single line. Since every tick-line in pfUI basically looks the same, it's pretty easy to identify.
Even with caching it to local, most of the GetTime() will reach out anyways and only the GetTime() is saved that is already limited inside the actual tick. I prefer to have it tidy in one line and to not put a new variable on the heap in every iteration just to save one function call that is already throttled.
only the GetTime() is saved that is already limited inside the actual tick.
Keep in mind that the code as it is right now is there are quite a few cases where GetTime() is called repeatedly inside for-loops multiple times. It's beyond just aesthetics.
Sorry, I have only checked the majority of this PR which have been the this.tick throttles.
You are right about the others. The ones that are repeatedly called inside for-loops like for debuffs and buffs, should really get cached only once per loop. For the others, that are only called about 1-3 times during OnUpdate, where 2-3 of them are also limited per X-second, I don't see a reason really.
https://github.com/shagu/pfUI/issues/1292