mirror of https://github.com/etcd-io/bbolt.git
replace buf[:] with buf (#238)
parent
126f21b002
commit
1d7842a624
6
db.go
6
db.go
|
@ -427,7 +427,7 @@ func (db *DB) init() error {
|
|||
// Create two meta pages on a buffer.
|
||||
buf := make([]byte, db.pageSize*4)
|
||||
for i := 0; i < 2; i++ {
|
||||
p := db.pageInBuffer(buf[:], pgid(i))
|
||||
p := db.pageInBuffer(buf, pgid(i))
|
||||
p.id = pgid(i)
|
||||
p.flags = metaPageFlag
|
||||
|
||||
|
@ -444,13 +444,13 @@ func (db *DB) init() error {
|
|||
}
|
||||
|
||||
// Write an empty freelist at page 3.
|
||||
p := db.pageInBuffer(buf[:], pgid(2))
|
||||
p := db.pageInBuffer(buf, pgid(2))
|
||||
p.id = pgid(2)
|
||||
p.flags = freelistPageFlag
|
||||
p.count = 0
|
||||
|
||||
// Write an empty leaf page at page 4.
|
||||
p = db.pageInBuffer(buf[:], pgid(3))
|
||||
p = db.pageInBuffer(buf, pgid(3))
|
||||
p.id = pgid(3)
|
||||
p.flags = leafPageFlag
|
||||
p.count = 0
|
||||
|
|
Loading…
Reference in New Issue