Skip to content

Commit

Permalink
add warning on speed (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
femshima authored Aug 3, 2024
1 parent bd3f9d2 commit 52c43af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ impl Condition {
/// Set speed.
///
/// Note: Default value is 1.0.
///
/// ## Security
///
/// Setting this parameter to near-zero value can lead to extremely high CPU time and memory consumption.
///
/// When providing untrusted input to this method, please remove such values in advance.
pub fn set_speed(&mut self, f: f64) {
self.speed = f.max(1.0E-06);
}
Expand Down

0 comments on commit 52c43af

Please sign in to comment.