diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-03-14 23:14:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 18:44:15 +0100 |
commit | b4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch) | |
tree | 10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /core/ops_metrics.rs | |
parent | 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff) |
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'core/ops_metrics.rs')
-rw-r--r-- | core/ops_metrics.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/core/ops_metrics.rs b/core/ops_metrics.rs index 35c1faf1c..b068aa0ee 100644 --- a/core/ops_metrics.rs +++ b/core/ops_metrics.rs @@ -59,20 +59,10 @@ impl OpsTracker { unsafe { &mut *self.ops.get() } } - #[inline] - fn ensure_capacity(ops: &mut Vec<OpMetrics>, op_id: OpId) { - if op_id >= ops.len() { - ops.resize(1 + op_id, OpMetrics::default()) - } - } - #[allow(clippy::mut_from_ref)] #[inline] fn metrics_mut(&self, id: OpId) -> &mut OpMetrics { - let ops = self.ops_mut(); - // TODO(@AaronO): Pre-alloc capacity at runtime init once we forbid post-boot op registrations - Self::ensure_capacity(ops, id); - unsafe { ops.get_unchecked_mut(id) } + unsafe { self.ops_mut().get_unchecked_mut(id) } } #[inline] |