git.samba.org
/
kamenim
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
606ff46
)
s4-ldb: fast path for equal pointers
author
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 00:05:15 +0000
(11:05 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 01:47:54 +0000
(12:47 +1100)
We compare identical ldb_val values surprisingly often
source4/lib/ldb/common/ldb_msg.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/common/ldb_msg.c
b/source4/lib/ldb/common/ldb_msg.c
index a8ea52b0b17f4c74f9f2cdca3d0e10b77fd2f795..a040043f87a6383ea59b74a1caa0ee23d22d4a2b 100644
(file)
--- 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) {