replace buf[:] with buf (#238)

pull/279/head
neza2017 2021-04-24 08:38:27 +08:00 committed by GitHub
parent 126f21b002
commit 1d7842a624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

6
db.go
View File

@ -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