ldb_tdb: Optimise ltdb_search_and_return_base() to re-use casefolding
authorAndrew Bartlett <abartlet@samba.org>
Wed, 30 Aug 2017 01:18:20 +0000 (13:18 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 22 Sep 2017 19:20:24 +0000 (21:20 +0200)
commitb0a6b5ab515661a7aa227e329e5a506fa802c198
tree7baf461d3abf1ac148f7e451a275f4aec86c9b10
parentf14370d4710d170a10d530a7bff9cd6cdd61dea0
ldb_tdb: Optimise ltdb_search_and_return_base() to re-use casefolding

The casefolding of a DN is one of the more expensive and pointless things in LDB
operation.  The ldb_dn abstraction works hard to avoid duplicating this work, but
we can work harder to save that information.

Here we copy in the DN, that has been casefolded already for the index,
and keep that as the returned DN, after stripping any extended components.

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