lib-core: useExtensions code improvement#299
lib-core: useExtensions code improvement#299openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e31ad13 to
1f2eba9
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #299 +/- ##
=======================================
Coverage 18.25% 18.25%
=======================================
Files 58 58
Lines 1758 1758
Branches 326 327 +1
=======================================
Hits 321 321
Misses 1421 1421
Partials 16 16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
78417b5 to
a806f0a
Compare
|
/retitle lib-core: useExtensions code improvement |
a806f0a to
3626501
Compare
|
/lgtm |
|
@logonoff: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
this PR aims to make
useExtensionsfaster and more readable:() => truepredicate is moved to the module level and is given a name (truePredicate) and is now set as the default param forpredicate. We also no longer create this function every iteration of the loopextensions.reduce, we simply usefilterwhich makes the intent behind our goal (i.e., filtering an array) more clear. This also reduces the amount of intermediary arrays that are created when computing this