engine: Simplify multiple chains processing #86

Merged
fyrchik merged 1 commit from fyrchik/policy-engine:refactor-rulefound into master 2024-08-19 07:35:16 +00:00
Owner

So, it's sunday evening and I am sitting on-call trying to debug strange
node behaviour. It took me 3 whole minutes to understand the code being
changed: it accumulates bools in slices, even though no slice is needed;
it uses subtle condition from the first loop to make decision in the
second one, and finally it uses named return values.

In this commit we remove the slice and the second loop, because why not.

Signed-off-by: Evgenii Stratonikov e.stratonikov@yadro.com

So, it's sunday evening and I am sitting on-call trying to debug strange node behaviour. It took me 3 whole minutes to understand the code being changed: it accumulates bools in slices, even though no slice is needed; it uses subtle condition from the first loop to make decision in the second one, and finally it uses named return values. In this commit we remove the slice and the second loop, because why not. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik added the
internal
label 2024-08-19 06:35:55 +00:00
fyrchik added 1 commit 2024-08-19 06:36:00 +00:00
engine: Simplify multiple chains processing
Some checks failed
DCO action / DCO (pull_request) Failing after 53s
Tests and linters / Tests (1.21) (pull_request) Successful in 48s
Tests and linters / Tests (1.20) (pull_request) Successful in 50s
Tests and linters / Tests with -race (pull_request) Successful in 1m11s
Tests and linters / Lint (pull_request) Successful in 1m41s
Tests and linters / Staticcheck (pull_request) Successful in 1m48s
a03c00c44f
So, it's sunday evening and I am sitting on-call trying to debug strange
node behaviour. It took me 3 whole minutes to understand the code being
changed: it accumulates bools in slices, even though no slice is needed;
it uses subtle condition from the first loop to make decision in the
second one, and finally it uses named return values.

In this commit we remove the slice and the second loop, because why not.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Author
Owner

The same logic is used in getStatusFromChains() from the same file, btw.

The same logic is used in `getStatusFromChains()` from the same file, btw.
fyrchik force-pushed refactor-rulefound from a03c00c44f to a11e80e2c7 2024-08-19 06:37:42 +00:00 Compare
dstepanov-yadro approved these changes 2024-08-19 06:41:30 +00:00
acid-ant approved these changes 2024-08-19 06:46:22 +00:00
fyrchik merged commit a11e80e2c7 into master 2024-08-19 07:35:16 +00:00
fyrchik deleted branch refactor-rulefound 2024-08-19 07:35:24 +00:00
Sign in to join this conversation.
No description provided.