bus/policy: separate prefix rules in default context 94/274494/1 accepted/tizen/unified/20220526.144439 submit/tizen/20220502.052537 submit/tizen/20220525.001052
authorAdrian Szyndela <adrian.s@samsung.com>
Fri, 29 Apr 2022 06:58:42 +0000 (08:58 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 29 Apr 2022 06:58:42 +0000 (08:58 +0200)
commit2091493e996ce159cb5d92adcf10def691214881
tree75437c52e57c19fb1f71d4bb8e4fcd97735f7714
parentdd366f2e664d660084fcbaaba30ae6c8dc8cdd4a
bus/policy: separate prefix rules in default context

To handle prefix rules stored with all other rules in the default context
we need to match each prefix of each name against policy rules.
That's because names are looked up in the hash tables, so we can
miss a prefix rule for a prefix of the name.

However, if prefix rules are separated from non-prefix rules, we
can simply check them all once for each name, and also check hash tables once
for each name.

This is what this commit changes. It separates prefix rules
from non-prefix rules, and handles them in sequence.

This gives a little boost, especially if there are no prefix rules.

Change-Id: Ifade906d35af96a973920ce9c2f6065f5b9b549e
bus/policy.c