TriggerMail / rules_pyz

Bazel Python rules that package everything in an executable zip
Apache License 2.0
29 stars 19 forks source link

rules_python_zip.bzl: _pyz_script_test_impl Remove O(N*M) loop #22

Closed evanj closed 6 years ago

evanj commented 6 years ago

The previous implementation looped over all mappings for each test src. This isn't terrible in practice since most tests will have a single src. However, if it has more, it is O(N*M) where N is the number of srcs and M in the number of mappings.

Instead, turn it into an O(N + M) loop by only traversing the srcs and mappings once each.