Fix potential panic (#2755)
* Fix potential panic * Update CHANGELOG.md * Use checked_div --------- Co-authored-by: Xiaopeng Li <lixiaopeng.jetspark@bytedance.com>
This commit is contained in:
parent
fbea75d31f
commit
2486f0f1a1
2 changed files with 4 additions and 1 deletions
|
|
@ -230,7 +230,9 @@ impl MonitorHandle {
|
|||
return None;
|
||||
}
|
||||
|
||||
Some((time.time_scale as i64 / time.time_value * 1000) as u32)
|
||||
(time.time_scale as i64)
|
||||
.checked_div(time.time_value)
|
||||
.map(|v| (v * 1000) as u32)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue