mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Fixes for gofmt -s
This commit is contained in:
@@ -906,7 +906,7 @@ func (c *client) processMsg(msg []byte) {
|
||||
if len(c.perms.pcache) > maxPermCacheSize {
|
||||
// Prune the permissions cache. Keeps us from unbounded growth.
|
||||
r := 0
|
||||
for subject, _ := range c.perms.pcache {
|
||||
for subject := range c.perms.pcache {
|
||||
delete(c.cache.results, subject)
|
||||
r++
|
||||
if r > pruneSize {
|
||||
@@ -950,7 +950,7 @@ func (c *client) processMsg(msg []byte) {
|
||||
if len(c.cache.results) > maxResultCacheSize {
|
||||
// Prune the results cache. Keeps us from unbounded growth.
|
||||
r := 0
|
||||
for subject, _ := range c.cache.results {
|
||||
for subject := range c.cache.results {
|
||||
delete(c.cache.results, subject)
|
||||
r++
|
||||
if r > pruneSize {
|
||||
|
||||
@@ -188,7 +188,7 @@ func (s *Sublist) addToCache(subject string, sub *subscription) {
|
||||
// removeFromCache will remove the sub from any active cache entries.
|
||||
// Assumes write lock is held.
|
||||
func (s *Sublist) removeFromCache(subject string, sub *subscription) {
|
||||
for k, _ := range s.cache {
|
||||
for k := range s.cache {
|
||||
if !matchLiteral(k, subject) {
|
||||
continue
|
||||
}
|
||||
@@ -231,7 +231,7 @@ func (s *Sublist) Match(subject string) *SublistResult {
|
||||
s.cache[subject] = result
|
||||
// Bound the number of entries to sublistMaxCache
|
||||
if len(s.cache) > slCacheMax {
|
||||
for k, _ := range s.cache {
|
||||
for k := range s.cache {
|
||||
delete(s.cache, k)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user