File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -261,24 +261,24 @@ func ParseMessage(line string) (*Message, error) {
261261 }
262262
263263 if line [0 ] == '@' {
264- split := strings .SplitN (line , " " , 2 )
265- if len ( split ) < 2 {
264+ loc := strings .Index (line , " " )
265+ if loc == - 1 {
266266 return nil , ErrMissingDataAfterTags
267267 }
268268
269- c .Tags = ParseTags (split [ 0 ][ 1 : ])
270- line = split [ 1 ]
269+ c .Tags = ParseTags (line [ 1 : loc ])
270+ line = line [ loc + 1 : ]
271271 }
272272
273273 if line [0 ] == ':' {
274- split := strings .SplitN (line , " " , 2 )
275- if len ( split ) < 2 {
274+ loc := strings .Index (line , " " )
275+ if loc == - 1 {
276276 return nil , ErrMissingDataAfterPrefix
277277 }
278278
279279 // Parse the identity, if there was one
280- c .Prefix = ParsePrefix (split [ 0 ][ 1 : ])
281- line = split [ 1 ]
280+ c .Prefix = ParsePrefix (line [ 1 : loc ])
281+ line = line [ loc + 1 : ]
282282 }
283283
284284 // Split out the trailing then the rest of the args. Because
You can’t perform that action at this time.
0 commit comments