Closed jessesomerville closed 2 years ago
Merging Update Removal of Bad Packages. Local testing completed.
Test validated:
go test -v
=== RUN TestRemoveBadPackages
=== RUN TestRemoveBadPackages/no_bad_packages
=== RUN TestRemoveBadPackages/one_bad_package
: === RUN TestRemoveBadPackages/all_packages_are_bad
:
:
: --- PASS: TestRemoveBadPackages (0.00s) --- PASS: TestRemoveBadPackages/no_bad_packages (0.00s) --- PASS: TestRemoveBadPackages/one_bad_package (0.00s) --- PASS: TestRemoveBadPackages/all_packages_are_bad (0.00s) PASS ok github.com/praetorian-inc/gokart/run 1.080s
Updated the way that bad packages are removed from the package list to be more efficient. The previous method ran in O(n*m) time (n = num of all packages, m = num of bad packages), and the updated method runs in O(n) and also cleans up some of the surrounding code to make it more readable.
Side note, this constant is deprecated and it's recommended to update to explicitly declaring which fields you need.