+ 1
Efficiency Question
Which of these, if they were to be called regularly, would be more efficient? Pseudo code: If num != 1: num = 1 Or........ num = 1 My question i guess is it faster to confirm that the number is a 1 or faster to just assign it anyway and move past it?
3 odpowiedzi
+ 8
If you'd decide to simply assign it and move on, it'd probably benefit you to note the repercussions ahead of time, depending on what you'd be doing, etc.
+ 1
In first an extra check if made in if condition. So definitely assignment faster than check + assignment.
0
What the benefit of condition there..?
Anyways always num=1