Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
millken committed Apr 5, 2022
1 parent 2b0f84d commit 3c2715d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type entry struct {
func (hdr EntryHeader) EntrySize() uint32 {
return EntryHeaderSize + uint32(hdr.KeySize) + hdr.ValueSize
}

func (e *EntryHeader) Encode() []byte {
var b [EntryHeaderSize]byte
intconv.PutUint32(b[0:4], e.ValueSize)
Expand Down
10 changes: 5 additions & 5 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ func (b *bucket) Init() {

func (b *bucket) Reset() {
b.mu.Lock()
defer b.mu.Unlock()
bm := b.items
for k := range bm {
delete(bm, k)
delete(b.items, k)
}
b.mu.Unlock()
}

func (b *bucket) Set(k uint64, item item) error {
func (b *bucket) Set(k uint64, it item) error {
b.mu.Lock()
b.items[k] = item
b.mu.Unlock()
defer b.mu.Unlock()
b.items[k] = it
return nil
}

Expand Down

0 comments on commit 3c2715d

Please sign in to comment.