summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_msg.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-22 11:05:15 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-22 12:47:54 +1100
commitc4cb0c520c4599d3d480a24b33473e304e172baf (patch)
tree534cdd21897b7f8055d8aa500e8dc36ff5e06330 /source4/lib/ldb/common/ldb_msg.c
parent606ff46447f9b1f8708270a69a248c3439408aab (diff)
downloadsamba-c4cb0c520c4599d3d480a24b33473e304e172baf.tar.gz
samba-c4cb0c520c4599d3d480a24b33473e304e172baf.tar.bz2
samba-c4cb0c520c4599d3d480a24b33473e304e172baf.zip
s4-ldb: fast path for equal pointers
We compare identical ldb_val values surprisingly often
Diffstat (limited to 'source4/lib/ldb/common/ldb_msg.c')
-rw-r--r--source4/lib/ldb/common/ldb_msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index a8ea52b0b1..a040043f87 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -63,7 +63,7 @@ struct ldb_message_element *ldb_msg_find_element(const struct ldb_message *msg,
int ldb_val_equal_exact(const struct ldb_val *v1, const struct ldb_val *v2)
{
if (v1->length != v2->length) return 0;
-
+ if (v1->data == v2->data) return 1;
if (v1->length == 0) return 1;
if (memcmp(v1->data, v2->data, v1->length) == 0) {