Don't pretend *parser.List is immutable
The functions in bpfix that take a *parser.List and return a modified *parser.List are always returning the same pointer and mutating the target of the pointer. Remove the extra unnecessary return value. Also extract the getLiteralListProperty function. Test: androidmk_test.go Change-Id: I08d8aff955c72b7916741cda8083974a49af4d6f
This commit is contained in:
@@ -239,12 +239,12 @@ func convertFile(filename string, buffer *bytes.Buffer) (string, []error) {
|
||||
}
|
||||
|
||||
// check for common supported but undesirable structures and clean them up
|
||||
fixed, err := bpfix.FixTree(tree, bpfix.NewFixRequest().AddAll())
|
||||
err := bpfix.FixTree(tree, bpfix.NewFixRequest().AddAll())
|
||||
if err != nil {
|
||||
return "", []error{err}
|
||||
}
|
||||
|
||||
out, err := bpparser.Print(fixed)
|
||||
out, err := bpparser.Print(tree)
|
||||
if err != nil {
|
||||
return "", []error{err}
|
||||
}
|
||||
|
Reference in New Issue
Block a user