Skip to content

Commit 4777f7a

Browse files
committed
Inline isequal() and isless() for Nullable
This enables SIMD for basic types when null_safe_op() is true. Inlining of the isequal() call on values still depends on the element type.
1 parent 2660cb0 commit 4777f7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/nullable.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If neither `x` nor `y` is null, compare them according to their values
105105
(i.e. `isequal(get(x), get(y))`). Else, return `true` if both arguments are null,
106106
and `false` if one is null but not the other: nulls are considered equal.
107107
"""
108-
function isequal{S,T}(x::Nullable{S}, y::Nullable{T})
108+
@inline function isequal{S,T}(x::Nullable{S}, y::Nullable{T})
109109
if null_safe_op(isequal, S, T)
110110
(x.isnull & y.isnull) | (!x.isnull & !y.isnull & isequal(x.value, y.value))
111111
else
@@ -132,7 +132,7 @@ If neither `x` nor `y` is null, compare them according to their values
132132
otherwise: nulls are always considered greater than non-nulls, but not greater than
133133
another null.
134134
"""
135-
function isless{S,T}(x::Nullable{S}, y::Nullable{T})
135+
@inline function isless{S,T}(x::Nullable{S}, y::Nullable{T})
136136
# NULL values are sorted last
137137
if null_safe_op(isless, S, T)
138138
(!x.isnull & y.isnull) | (!x.isnull & !y.isnull & isless(x.value, y.value))

0 commit comments

Comments
 (0)