Skip to content

Commit

Permalink
Crash fix on noise filter for empty spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Nov 29, 2023
1 parent a13544c commit 80af16d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spectrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl RawSpectrum {
.iter()
.map(|p| p.intensity)
.reduce(f64::max)
.unwrap();
.unwrap_or(f64::INFINITY);
self.spectrum
.retain(|p| p.intensity >= max * filter_threshold);
self.spectrum.shrink_to_fit();
Expand Down

0 comments on commit 80af16d

Please sign in to comment.