diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-05-11 11:27:00 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-05-11 11:27:00 +0200 |
| commit | 2f0b5eeae09bd880e4552bb83e44d9cd32571c58 (patch) | |
| tree | 6989d423e6bb614b3224be53140e4d649033aeac /library/src/meta/counter.rs | |
| parent | 47dff3765de863554ca296448555599fc50d4a8a (diff) | |
More efficient introspection
Switches from a mutable locator to one based on tracked chains and optimizes query performance.
Diffstat (limited to 'library/src/meta/counter.rs')
| -rw-r--r-- | library/src/meta/counter.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/src/meta/counter.rs b/library/src/meta/counter.rs index 50a097af..5c23c536 100644 --- a/library/src/meta/counter.rs +++ b/library/src/meta/counter.rs @@ -396,7 +396,7 @@ impl Counter { self.sequence_impl( vt.world, TrackedMut::reborrow_mut(&mut vt.tracer), - TrackedMut::reborrow_mut(&mut vt.provider), + vt.locator.track(), vt.introspector, ) } @@ -407,10 +407,11 @@ impl Counter { &self, world: Tracked<dyn World + '_>, tracer: TrackedMut<Tracer>, - provider: TrackedMut<StabilityProvider>, + locator: Tracked<Locator>, introspector: Tracked<Introspector>, ) -> SourceResult<EcoVec<(CounterState, NonZeroUsize)>> { - let mut vt = Vt { world, tracer, provider, introspector }; + let mut locator = Locator::chained(locator); + let mut vt = Vt { world, tracer, locator: &mut locator, introspector }; let mut state = CounterState(match &self.0 { // special case, because pages always start at one. CounterKey::Page => smallvec![1], |
