bus/policy: separate prefix rules in default context 39/274539/1 accepted/tizen_6.5_unified accepted/tizen/6.5/unified/20220502.230413 submit/tizen_6.5/20220502.052515
authorAdrian Szyndela <adrian.s@samsung.com>
Fri, 29 Apr 2022 06:58:42 +0000 (08:58 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 2 May 2022 05:00:29 +0000 (05:00 +0000)
commiteb7c740eade2c530ca1cd795be80011028a1a5f8
tree75437c52e57c19fb1f71d4bb8e4fcd97735f7714
parent9a2dd706fd41a150e9b7dd6fd2c4ce7a77812589
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
(cherry picked from commit 2091493e996ce159cb5d92adcf10def691214881)
bus/policy.c