We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e92fa68 + 3c66554 commit f69f9f9Copy full SHA for f69f9f9
message.go
@@ -187,12 +187,7 @@ func doParsing(mp *msgParser) (err error) {
187
mp.msg.Trailer.Clear()
188
189
// Allocate expected message fields in one chunk.
190
- fieldCount := 0
191
- for _, b := range mp.rawBytes {
192
- if b == '\001' {
193
- fieldCount++
194
- }
195
+ fieldCount := bytes.Count(mp.rawBytes, []byte{'\001'})
196
if fieldCount == 0 {
197
return parseError{OrigError: fmt.Sprintf("No Fields detected in %s", string(mp.rawBytes))}
198
}
0 commit comments