[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Thu Jun 14 08:56:04 MDT 2012
The branch, master has been updated
via 2fd28dc s3: Simplify tdb_data_is_cstr a bit
from bc9003d tdb2: remove unused debug_fprintf() macro that breaks the build
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 2fd28dc4cf4f40a690adfd846911e4da1a776bf2
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jun 13 09:48:25 2012 +0200
s3: Simplify tdb_data_is_cstr a bit
The original code contained rawmemchr for performance reasons. I
would expect the very common strlen routine to be not much worse
performance-wise than rawmemchr. On top, for me this patch simplifies
the expression a bit.
Signed-off-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Thu Jun 14 16:55:58 CEST 2012 on sn-devel-104
-----------------------------------------------------------------------
Summary of changes:
source3/utils/net_registry_check.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 6e455db..58cd9f6 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -211,7 +211,7 @@ static bool tdb_data_is_cstr(TDB_DATA d) {
if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) {
return false;
}
- return strchr((char *)d.dptr, '\0') == (char *)&d.dptr[d.dsize-1];
+ return strlen((char *)d.dptr) == d.dsize-1;
}
static char* tdb_data_print(TALLOC_CTX *mem_ctx, TDB_DATA d)
--
Samba Shared Repository
More information about the samba-cvs
mailing list