Skip to content

Commit 11041bc

Browse files
committed
fixup! For performance, switch to a row count estimate for users and devices
1 parent cbedf9b commit 11041bc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/syn2mas/src/migration.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ pub async fn migrate(
161161
// `(MAS user_id, device_id)` mapped to `compat_session` ULID
162162
let mut devices_to_compat_sessions: HashMap<(Uuid, CompactString), Uuid> =
163163
HashMap::with_capacity(
164-
counts
165-
.devices
166-
.try_into()
164+
usize::try_from(counts.devices)
167165
.expect("More than usize::MAX devices — unable to handle this many!")
168166
// Oversize the capacity, because the count is only an estimate and
169167
// we would like to avoid a reallocation

0 commit comments

Comments
 (0)