From 1c9434612788fb1df7ad03da64f1d8c85ddd252b Mon Sep 17 00:00:00 2001 From: shrsv Date: Mon, 19 Oct 2026 10:37:08 +0000 Subject: [PATCH] feat: add Store.Exists lookup helper (strict-calibration org) LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%) --- internal/store_lookup.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 internal/store_lookup.go diff --git a/internal/store_lookup.go b/internal/store_lookup.go new file mode 100644 index 0000000..18c8e13 --- /dev/null +++ b/internal/store_lookup.go @@ -0,0 +1,10 @@ +package internal + +// Exists reports whether key is present in the store, without allocating a +// value copy -- useful for existence checks ahead of a Set/Delete. +func (s *Store) Exists(key string) bool { + s.mu.RLock() + defer s.mu.RUnlock() + _, ok := s.data[key] + return ok +}