From c4cb0c520c4599d3d480a24b33473e304e172baf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Oct 2009 11:05:15 +1100 Subject: s4-ldb: fast path for equal pointers We compare identical ldb_val values surprisingly often --- source4/lib/ldb/common/ldb_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb/common') 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) { -- cgit