Skip to content

Commit 9d139f5

Browse files
authored
iszero check in hessenberg setindex (#1327)
Instead of explicitly checking that the value `== 0`, we should ideally call `iszero` on it.
1 parent dccd6f8 commit 9d139f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hessenberg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ Base._reverse(A::UpperHessenberg, dims) = reverse!(Matrix(A); dims)
103103

104104
Base.@propagate_inbounds function setindex!(A::UpperHessenberg, x, i::Integer, j::Integer)
105105
if i > j+1
106-
x == 0 || throw(ArgumentError("cannot set index in the lower triangular part " *
107-
lazy"($i, $j) of an UpperHessenberg matrix to a nonzero value ($x)"))
106+
iszero(x) || throw(ArgumentError(LazyString("cannot set index in the lower triangular part ",
107+
lazy"($i, $j) of an UpperHessenberg matrix to a nonzero value ($x)")))
108108
else
109109
A.data[i,j] = x
110110
end

0 commit comments

Comments
 (0)