Komag
11 years agoRoku Guru
Which is faster, checking a bool is True, or an integer > 0?
Just planning ahead a bit with code decisions. I usually do what makes the most sense for readability, etc. But sometimes it really doesn't matter as far as that goes, but might matter for speed for something I need to do every frame, so I search for the fastest method.
Is there any difference between checking whether a boolean is true vs checking an integer is > 0 (or whatever)? I can't tell any difference at this point, but I just wonder if down the road it will add enough to matter.
Is there any difference between checking whether a boolean is true vs checking an integer is > 0 (or whatever)? I can't tell any difference at this point, but I just wonder if down the road it will add enough to matter.