From b93d79c5a72abe1441afd454f47e4bebc97669e7 Mon Sep 17 00:00:00 2001 From: Felix Hagemann <30291312+fhagemann@users.noreply.github.com> Date: Sat, 29 Jul 2023 10:15:27 +0200 Subject: [PATCH] Remove type comparison in `==` for `RDWaveform` --- src/detector_waveforms.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/detector_waveforms.jl b/src/detector_waveforms.jl index 79a6688..2117c66 100644 --- a/src/detector_waveforms.jl +++ b/src/detector_waveforms.jl @@ -36,9 +36,7 @@ export RDWaveform RDWaveform{T,U,TV,UV}(wf::RDWaveform) where {T,U,TV,UV} = RDWaveform{T,U,TV,UV}(wf.time, wf.signal) Base.convert(::Type{RDWaveform{T,U,TV,UV}}, wf::RDWaveform) where {T,U,TV,UV} = RDWaveform{T,U,TV,UV}(wf) -Base.:(==)(wf1::RDWaveform, wf2::RDWaveform) = - typeof(wf1) == typeof(wf2) && wf1.time == wf2.time && wf1.signal == wf2.signal - +Base.:(==)(a::RDWaveform, b::RDWaveform) = a.time == b.time && a.signal == b.signal Base.isapprox(a::RDWaveform, b::RDWaveform; kwargs...) = isapprox(a.time, b.time; kwargs...) && isapprox(a.signal, b.signal; kwargs...) Base.float(wf::RDWaveform) = RDWaveform(float(wf.time), float(wf.signal))