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
diff --git a/bpfix/cmd/bpfix.go b/bpfix/cmd/bpfix.go
index f51c6f7..461f41d 100644
--- a/bpfix/cmd/bpfix.go
+++ b/bpfix/cmd/bpfix.go
@@ -75,13 +75,13 @@
}
// compute and apply any requested fixes
- fixed, err := bpfix.FixTree(file, fixRequest)
+ err = bpfix.FixTree(file, fixRequest)
if err != nil {
return err
}
// output the results
- res, err := parser.Print(fixed)
+ res, err := parser.Print(file)
if err != nil {
return err
}