ldb_tdb: Use the binary search more efficiently in list_intersect()
commit97b026a73fafa0d8b54d3b69fcce604d8c44ebcc
authorAndrew Bartlett <abartlet@samba.org>
Mon, 21 Aug 2017 23:16:56 +0000 (22 11:16 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 22 Sep 2017 19:20:23 +0000 (22 21:20 +0200)
treec99319335079907fe5a81434aaf02dbfdb7563d6
parentb6bf7e7b0b8bd11d2c804125140b2a8077c11d85
ldb_tdb: Use the binary search more efficiently in list_intersect()

This change ensures we walk the short list and look up into the longer of the two lists.

ltdb_dn_list_find_val() will do a binary search for the GUID case.

Before GUID indexes this was O(n*m), now it is O(n*log(m)).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_tdb/ldb_index.c