Hello my name is Mikal.
I am working on some python code, and it is now at the point where it does what I want, but its not quite fast enough for my liking.
Here is my current code that works:
self.timersVS = {'combat':0,'regen':0}
...
# Tick Timers and clamp
for key,value in self.timersVS.iteritems():
if value <= 1:
self.timersVS[key] = 0
continue
else:
self.timersVS[key] -= 1
Is the following code the same, and is there any improvement over using it? Is there a more efficient way of writing this functionallity?
self.timersVS = {'combat':0,'regen':0}
...
# Tick Timers and clamp
self.timersVS = [x - 1 for x in self.timersVS if x]
Thank you so much!
-Mikal