Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
xichen2020 committed Jun 19, 2017
1 parent 13a7bda commit 5b135d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions matcher/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ func (n *namespaces) Version(namespace []byte) int {
nsHash := xid.HashFn(namespace)
n.RLock()
ruleSet, exists := n.rules[nsHash]
n.RUnlock()
if !exists {
n.RUnlock()
return kv.UninitializedVersion
}
n.RUnlock()
return ruleSet.Version()
}

Expand All @@ -143,12 +142,11 @@ func (n *namespaces) Match(namespace, id []byte, fromNanos, toNanos int64) rules
)
n.RLock()
ruleSet, exists := n.rules[nsHash]
n.RUnlock()
if !exists {
n.RUnlock()
n.metrics.notExists.Inc(1)
return res
}
n.RUnlock()
return ruleSet.Match(id, fromNanos, toNanos)
}

Expand Down

0 comments on commit 5b135d3

Please sign in to comment.