Skip to content

Commit

Permalink
Merge pull request #5 from rus-alex/fix/mistype
Browse files Browse the repository at this point in the history
uncallabale -> uncallable
  • Loading branch information
uprendis authored Dec 7, 2022
2 parents fb17308 + ed6db75 commit 6fd6e65
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions utils/dbutil/switchable/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ func decodePair(b []byte) (uint32, uint32) {
return v1, v2
}

type UncallabaleAfterRelease struct {
type UncallableAfterRelease struct {
kvdb.Snapshot
iterators []*uncallabaleAfterReleaseIterator
iterators []*uncallableAfterReleaseIterator
mu sync.Mutex
}

type uncallabaleAfterReleaseIterator struct {
type uncallableAfterReleaseIterator struct {
kvdb.Iterator
}

func (db *UncallabaleAfterRelease) NewIterator(prefix []byte, start []byte) kvdb.Iterator {
func (db *UncallableAfterRelease) NewIterator(prefix []byte, start []byte) kvdb.Iterator {
it := db.Snapshot.NewIterator(prefix, start)
wrapped := &uncallabaleAfterReleaseIterator{it}
wrapped := &uncallableAfterReleaseIterator{it}

db.mu.Lock()
defer db.mu.Unlock()
Expand All @@ -42,7 +42,7 @@ func (db *UncallabaleAfterRelease) NewIterator(prefix []byte, start []byte) kvdb
return wrapped
}

func (db *UncallabaleAfterRelease) Release() {
func (db *UncallableAfterRelease) Release() {
db.Snapshot.Release()
// ensure nil pointer exception on any next call
db.Snapshot = nil
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestSnapshot_SwitchTo(t *testing.T) {
// 4 readers, one interrupter
snap, err := memdb.GetSnapshot()
require.NoError(err)
switchable := Wrap(&UncallabaleAfterRelease{
switchable := Wrap(&UncallableAfterRelease{
Snapshot: snap,
})

Expand Down Expand Up @@ -137,7 +137,7 @@ func TestSnapshot_SwitchTo(t *testing.T) {
for atomic.LoadUint32(&stop) == 0 {
snap, err := memdb.GetSnapshot()
require.NoError(err)
old := switchable.SwitchTo(&UncallabaleAfterRelease{
old := switchable.SwitchTo(&UncallableAfterRelease{
Snapshot: snap,
})
old.Release()
Expand Down

0 comments on commit 6fd6e65

Please sign in to comment.