mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-09-07 08:00:56 +00:00
Previously, the use of BTreeMap for the rules resulted in the overall rule order being changed in a surprising way; the key order of the map set the overall order by category and then by the order that the rules appeared in the file. This commit uses an OrderMap to preserve the ordering of the keys in the TOML (or JSON) file so that they match the order in which they appear in the file, rather than having them become implicit sorted by key. Secondly, it removes the use of BTreeMap in the overall classifier state, so that the all of the patterns are presented in the order in which they appeared in the sequence of files loaded in the classifier setup. A unit test has been added to assert that matching of ambiguous (in this case, identical) patterns takes its precedence from the order that the patterns appear in the file.