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:
Colin Cross
2018-02-21 16:30:17 -08:00
parent fabb608b27
commit 3fad895e75
4 changed files with 32 additions and 32 deletions

View File

@@ -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}
}