mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-24 08:34:12 +00:00
Comment why as i64 is safe
This commit is contained in:
1 parent
ebb587e426
commit
1cb9fabade
1 file changed
+3
@@ -584,6 +584,9 @@ fn serialize_event_value(
|
||||
if let Some(sticky_duration) = event.sticky_duration() {
|
||||
// min() ensures the origin server can't claim a time in the future
|
||||
// to exceed the stickiness duration limit.
|
||||
//
|
||||
// The `as i64` cast is safe as sticky duration are capped to an
|
||||
// hour, which is well within the i64 range.
|
||||
let expires_at = std::cmp::min(event.origin_server_ts(), time_now_ms)
|
||||
+ sticky_duration.as_millis() as i64;
|
||||
if expires_at > time_now_ms {
|
||||
|
||||
Reference in new issue
Block a user