Skip to content

Commit

Permalink
Entry RemoveReason is iota based with default value being 0
Browse files Browse the repository at this point in the history
Currently all const for RemovedReason are explicitly
set to avoid any breaking changes. For v3 migrating the reasons
to iota makes code readability and managing addition of more reasons
easier in the future.

Test: Validated all test cases run successfully.
  • Loading branch information
jgheewala committed Nov 18, 2020
1 parent 83cd9cd commit c3845a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bigcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ type RemoveReason uint32
const (
_ RemoveReason = iota
// Expired means the key is past its LifeWindow.
Expired = RemoveReason(1)
Expired
// NoSpace means the key is the oldest and the cache size was at its maximum when Set was called, or the
// entry exceeded the maximum shard size.
NoSpace = RemoveReason(2)
NoSpace
// Deleted means Delete was called and this key was removed as a result.
Deleted = RemoveReason(3)
Deleted
)

// NewBigCache initialize new instance of BigCache
Expand Down

0 comments on commit c3845a8

Please sign in to comment.