Skip to content

Commit

Permalink
replace buf[:] with buf (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
neza2017 committed Apr 24, 2021
1 parent 126f21b commit 1d7842a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 1d7842a

Please sign in to comment.