From 46c6d81a4a977c9a83cfd53c2d748876a080dc71 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 20 Oct 2005 16:05:12 +0000 Subject: r11229: an even bigger speedup spotted by Volker. string_to_sid() is now taking 1/5th the time it used to. Replace strcasecmp with invididual char checks for "S-" sid prefix. (This used to be commit de3d0094b78cb20da7ed958e8d3a428583694309) --- source3/lib/util_sid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index cc1f55330f..0a9e6fe310 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -262,12 +262,12 @@ BOOL string_to_sid(DOM_SID *sidout, const char *sidstr) /* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */ uint32 conv; - if (StrnCaseCmp( sidstr, "S-", 2)) { + if ((sidstr[0] != 'S' && sidstr[0] != 's') || sidstr[1] != '-') { DEBUG(0,("string_to_sid: Sid %s does not start with 'S-'.\n", sidstr)); return False; } - ZERO_STRUCTP(sidout); +// ZERO_STRUCTP(sidout); /* Get the revision number. */ p = sidstr + 2; -- cgit