Skip to content

Commit

Permalink
remove === for singleton equality tip (JuliaLang#40517)
Browse files Browse the repository at this point in the history
With JuliaLang#38905 merged, this shouldn't apply in general anymore. I am sure with `==` being a generic function, there will still be cases where using `===` will lead to more precise inference, but I don't think this is worth specifically mentioning in the performance tips.
  • Loading branch information
simeonschaub authored Apr 20, 2021
1 parent d998c7e commit ba71161
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions doc/src/manual/performance-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -1600,11 +1600,3 @@ will not require this degree of programmer annotation to attain performance.
In the mean time, some user-contributed packages like
[FastClosures](https://github.com/c42f/FastClosures.jl) automate the
insertion of `let` statements as in `abmult3`.

## Checking for equality with a singleton

When checking if a value is equal to some singleton it can be
better for performance to check for identicality (`===`) instead of
equality (`==`). The same advice applies to using `!==` over `!=`.
These type of checks frequently occur e.g. when implementing the iteration
protocol and checking if `nothing` is returned from [`iterate`](@ref).

0 comments on commit ba71161

Please sign in to comment.