From 3c11561d5327c6df45d59e1931eba16f006000d5 Mon Sep 17 00:00:00 2001 From: Shoyu Vanilla Date: Wed, 21 Jan 2026 01:52:12 +0900 Subject: [PATCH] Add a new API for probing the root key along with the value --- src/unify/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/unify/mod.rs b/src/unify/mod.rs index 41c9d46..a8ebdc0 100644 --- a/src/unify/mod.rs +++ b/src/unify/mod.rs @@ -570,6 +570,18 @@ where let id = self.inlined_get_root_key(id); self.value(id).value.clone() } + + // An always-inlined version of `probe_value`, for hot callsites. + // And returns the root key of the given key along with the value. + #[inline(always)] + pub fn inlined_probe_key_value(&mut self, id: K1) -> (K, V) + where + K1: Into, + { + let id = id.into(); + let id = self.inlined_get_root_key(id); + (id, self.value(id).value.clone()) + } } ///////////////////////////////////////////////////////////////////////////