mirror of https://github.com/etcd-io/bbolt.git
Avoid unnecessary conversions
No need to convert here, they are already of the right type.pull/171/head
parent
0362320deb
commit
0bf4edcf32
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue