You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think read somewhere that =:= is more equal than == :-)
In comparisons like these, would you use =:= because it is more correct/better style, or because you would expect better performance?
The reason will be displayed to describe this comment to others. Learn more.
Both, actually.
The use of =:= is more correct because the test will not accidentally succeed if a float somehow ends up there,
and you can expect slightly better performance because the compiler does not have to (generate code that) checks for floats.
f092e55There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably also want to use =:= instead of == throughout.
f092e55There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think read somewhere that =:= is more equal than == :-)
In comparisons like these, would you use =:= because it is more correct/better style, or because you would expect better performance?
f092e55There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both, actually.
The use of =:= is more correct because the test will not accidentally succeed if a float somehow ends up there,
and you can expect slightly better performance because the compiler does not have to (generate code that) checks for floats.
f092e55There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool:
faa8a31