MCPcopy Index your code
hub / github.com/golang/groupcache / EqualBytes

Method EqualBytes

byteview.go:123–137  ·  view source on GitHub ↗

EqualBytes returns whether the bytes in b are the same as the bytes in b2.

(b2 []byte)

Source from the content-addressed store, hash-verified

121// EqualBytes returns whether the bytes in b are the same as the bytes
122// in b2.
123func (v ByteView) EqualBytes(b2 []byte) bool {
124 if v.b != nil {
125 return bytes.Equal(v.b, b2)
126 }
127 l := v.Len()
128 if len(b2) != l {
129 return false
130 }
131 for i, bi := range b2 {
132 if bi != v.s[i] {
133 return false
134 }
135 }
136 return true
137}
138
139// Reader returns an io.ReadSeeker for the bytes in v.
140func (v ByteView) Reader() io.ReadSeeker {

Callers 2

EqualMethod · 0.95
TestByteViewEqualFunction · 0.80

Calls 2

LenMethod · 0.95
EqualMethod · 0.80

Tested by 1

TestByteViewEqualFunction · 0.64