Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/store/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ import (
// Registry maps ID to Store and Name to ID.
type Registry struct {
nextID uint64
byID map[ID]Store
byID map[ID]*Store
nameToID map[Name]ID
mu sync.RWMutex
}

// NewRegistry creates a Registry.
func NewRegistry() *Registry {
return &Registry{
byID: make(map[ID]Store),
byID: make(map[ID]*Store),
nameToID: make(map[Name]ID),
}
}

// Put maps the given Store by a generated ID, and maps the given Name to generated ID.
func (r *Registry) Put(name Name, store Store) (ID, error) {
func (r *Registry) Put(name Name, store *Store) (ID, error) {
r.mu.Lock()
defer r.mu.Unlock()

Expand All @@ -38,7 +38,7 @@ func (r *Registry) Put(name Name, store Store) (ID, error) {
}

// Get returns the Store by ID.
func (r *Registry) Get(id ID) (Store, bool) {
func (r *Registry) Get(id ID) (*Store, bool) {
r.mu.RLock()
defer r.mu.RUnlock()

Expand Down
Loading