]> granicus.if.org Git - ejabberd/commit
Speed up ejabberd_s2s:is_service/2, allow_host/2 (thanks to Andreas Köhler)(EJAB...
authorBadlop <badlop@process-one.net>
Thu, 14 Oct 2010 19:15:40 +0000 (21:15 +0200)
committerBadlop <badlop@process-one.net>
Thu, 14 Oct 2010 19:15:40 +0000 (21:15 +0200)
commita5230c46c2e9e2141cbec9b3c0a5493e41739346
tree5dad7837eb883439b641adfc2d2322e34d697cf6
parent95ce77f80d2c19bd5bc930c100603c77f54119c6
Speed up ejabberd_s2s:is_service/2, allow_host/2 (thanks to Andreas Köhler)(EJAB-1319)

Iterating through the list of possible parent domains of a given domain
and comparing with the list of hosts or routes is almost always faster
than doing it the other way around. It naturally returns the shortest or
longest parent domain satisfying a predicate, whereas the possibly long
list compared with would need to be sorted by length first.
src/ejabberd_s2s.erl