Skip to content

Commit 0f49905

Browse files
committed
parser: remove bogus string byteslice conversion
Signed-off-by: Tonis Tiigi <[email protected]>
1 parent 8b57d7e commit 0f49905

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/dockerfile/parser/parser.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ func (d *directives) setEscapeToken(s string) error {
168168
// possibleParserDirective looks for parser directives, eg '# escapeToken=<char>'.
169169
// Parser directives must precede any builder instruction or other comments,
170170
// and cannot be repeated.
171-
func (d *directives) possibleParserDirective(line string) error {
172-
directive, err := d.parser.ParseLine([]byte(line))
171+
func (d *directives) possibleParserDirective(line []byte) error {
172+
directive, err := d.parser.ParseLine(line)
173173
if err != nil {
174174
return err
175175
}
@@ -528,7 +528,7 @@ func processLine(d *directives, token []byte, stripLeftWhitespace bool) ([]byte,
528528
if stripLeftWhitespace {
529529
token = trimLeadingWhitespace(token)
530530
}
531-
return trimComments(token), d.possibleParserDirective(string(token))
531+
return trimComments(token), d.possibleParserDirective(token)
532532
}
533533

534534
// Variation of bufio.ScanLines that preserves the line endings

0 commit comments

Comments
 (0)