Skip to content

Commit

Permalink
stdlib: add math/bits package
Browse files Browse the repository at this point in the history
  • Loading branch information
douyixuan committed Aug 9, 2024
1 parent 679e6b3 commit 7e8adf0
Show file tree
Hide file tree
Showing 3 changed files with 436 additions and 11 deletions.
10 changes: 5 additions & 5 deletions pkg/bytes/buffer.cell
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ const maxInt = 2147483647
//
// In most cases, new([Buffer]) (or just declaring a [Buffer] variable) is
// sufficient to initialize a [Buffer].
// func NewBuffer(buf []byte) *Buffer {
// var b Buffer
// b.buf = buf
// return &b
// }
func NewBuffer(buf []byte) *Buffer {
var b Buffer
b.buf = buf
return &b
}

// NewBufferString creates and initializes a new [Buffer] using string s as its
// initial contents. It is intended to prepare a buffer to read an existing
Expand Down
Loading

0 comments on commit 7e8adf0

Please sign in to comment.