Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority 1 should be higher priority than 2 !? #141

Open
nileio opened this issue Jan 13, 2024 · 0 comments
Open

Priority 1 should be higher priority than 2 !? #141

nileio opened this issue Jan 13, 2024 · 0 comments

Comments

@nileio
Copy link

nileio commented Jan 13, 2024

First of all thanks for the module!
It was not immediately available to me that priorities of rules are not as I'd expect them to be.. usually priority 1 is higher priority than priority 2 , 3 , etc.
On debugging my code, I discovered that the order of rules evaluation starts from the highest number.. thisHolder.activeRules array orders by higher numbers first.

This might just be semantic, but often priority with lower numbers precede the higher numbers because they are considered high importance, also in many situations we do not know the number of rules in advance , so it is much easier to just start from 1 ..

i know this can be a breaking change but I just thought to mention in case others have not noticed it too..
I also noted that the wiki explains that higher number priorities are evaluated first, but I must admit I did not read it initially and have not paid enough attention, as I thought priority 1 means higher priority ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant