From 2bda81e60c144f3d55e2d2b1f1872921c4b0998a Mon Sep 17 00:00:00 2001 From: shrsv Date: Mon, 19 Oct 2026 10:36:53 +0000 Subject: [PATCH] feat: add Store.Exists lookup helper 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 +}