Skip to content

Commit 91472d1

Browse files
Rename valueReaderByteSrc to byteSrc
1 parent 35b3d88 commit 91472d1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bson/buffered_byte_src.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type bufferedByteSrc struct {
1919
offset int64 // Current read index into buf
2020
}
2121

22-
var _ valueReaderByteSrc = (*bufferedByteSrc)(nil)
22+
var _ byteSrc = (*bufferedByteSrc)(nil)
2323

2424
// Read reads up to len(p) bytes from the in-memory buffer, advancing the offset
2525
// by the number of bytes read.

bson/streaming_byte_src.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type streamingByteSrc struct {
2222
offset int64 // offset is the current read position in the buffer
2323
}
2424

25-
var _ valueReaderByteSrc = (*streamingByteSrc)(nil)
25+
var _ byteSrc = (*streamingByteSrc)(nil)
2626

2727
// Read reads up to len(p) bytes from the underlying bufio.Reader, advancing
2828
// the offset by the number of bytes read.

bson/value_reader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"sync"
1717
)
1818

19-
type valueReaderByteSrc interface {
19+
type byteSrc interface {
2020
io.ByteReader
2121

2222
readExact(p []byte) (int, error)
@@ -72,7 +72,7 @@ var vrPool = sync.Pool{
7272

7373
// valueReader is for reading BSON values.
7474
type valueReader struct {
75-
src valueReaderByteSrc
75+
src byteSrc
7676
offset int64
7777

7878
stack []vrState
@@ -278,7 +278,7 @@ func peekNextValueSize(vr *valueReader) (int32, error) {
278278

279279
// readBytes tries to grab the next n bytes zero-allocation using peek+discard.
280280
// If peek fails (e.g. bufio buffer full), it falls back to io.ReadFull.
281-
func readBytes(src valueReaderByteSrc, n int) ([]byte, error) {
281+
func readBytes(src byteSrc, n int) ([]byte, error) {
282282
if src.streamable() {
283283
data := make([]byte, n)
284284
if _, err := src.readExact(data); err != nil {

0 commit comments

Comments
 (0)