Skip to content

Commit

Permalink
Avoid unnecessary conversions
Browse files Browse the repository at this point in the history
No need to convert here, they are already of the right type.
  • Loading branch information
muesli committed Aug 6, 2019
1 parent 0362320 commit 0bf4edc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/bbolt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ func (cmd *PageCommand) PrintFreelist(w io.Writer, buf []byte) error {

// Print each page in the freelist.
ids := (*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr))
for i := int(idx); i < count; i++ {
for i := idx; i < count; i++ {
fmt.Fprintf(w, "%d\n", ids[i])
}
fmt.Fprintf(w, "\n")
Expand Down
2 changes: 1 addition & 1 deletion cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (c *Cursor) node() *node {
}
for _, ref := range c.stack[:len(c.stack)-1] {
_assert(!n.isLeaf, "expected branch node")
n = n.childAt(int(ref.index))
n = n.childAt(ref.index)
}
_assert(n.isLeaf, "expected leaf node")
return n
Expand Down
2 changes: 1 addition & 1 deletion freelist_hmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (f *freelist) hashmapAllocate(txid txid, n int) pgid {
f.allocs[pid] = txid

for i := pgid(0); i < pgid(n); i++ {
delete(f.cache, pid+pgid(i))
delete(f.cache, pid+i)
}
return pid
}
Expand Down

0 comments on commit 0bf4edc

Please sign in to comment.