From 3b9e405565aeb2982625449d6dd77254799dfefd Mon Sep 17 00:00:00 2001 From: kalmar Date: Mon, 10 Jul 2017 19:25:52 +0200 Subject: [PATCH] use a single zero object to compare --- src/GroupRings.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 20703e7..51f29f6 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -311,10 +311,11 @@ end function mul!{T}(X::AbstractVector{T}, Y::AbstractVector{T}, pm::Array{Int,2}, result::AbstractVector{T}) + z = zero(T) for (j,y) in enumerate(Y) - if y != zero(eltype(Y)) + if y != z for (i, index) in enumerate(pm[:,j]) - if X[i] != zero(eltype(X)) + if X[i] != z index == 0 && throw(ArgumentError("The product don't seem to belong to the span of basis!")) result[index] += X[i]*y end