summaryrefslogtreecommitdiff
path: root/library/src/meta/counter.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-05-11 11:27:00 +0200
committerLaurenz <laurmaedje@gmail.com>2023-05-11 11:27:00 +0200
commit2f0b5eeae09bd880e4552bb83e44d9cd32571c58 (patch)
tree6989d423e6bb614b3224be53140e4d649033aeac /library/src/meta/counter.rs
parent47dff3765de863554ca296448555599fc50d4a8a (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.rs7
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],