Author: tridge
Date: 2005-01-16 20:48:53 +0000 (Sun, 16 Jan 2005)
New Revision: 4781

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4781

Log:
the tolower() in schema.c is a premature optimisation. I suspect the
"distinguishedName" checking in that module is incorrect and should be
removed, but meanwhile, lets not make it slow down the compile of
every other module.


Modified:
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/lib/ldb/modules/schema.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/includes.h
===================================================================
--- branches/SAMBA_4_0/source/include/includes.h        2005-01-16 20:20:15 UTC 
(rev 4780)
+++ branches/SAMBA_4_0/source/include/includes.h        2005-01-16 20:48:53 UTC 
(rev 4781)
@@ -53,10 +53,6 @@
 #include <stddef.h>
 #include <sys/time.h>
 
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif

Modified: branches/SAMBA_4_0/source/lib/ldb/modules/schema.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/modules/schema.c  2005-01-16 20:20:15 UTC 
(rev 4780)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/schema.c  2005-01-16 20:48:53 UTC 
(rev 4781)
@@ -35,6 +35,7 @@
 #include "includes.h"
 #include "ldb/include/ldb.h"
 #include "ldb/include/ldb_private.h"
+#include <ctype.h>
 
 struct attribute_syntax {
        const char *name;
@@ -103,16 +104,14 @@
 
        ret = ldb_attr_cmp(attr1, attr2);
        if (ret != 0) {
-               if (tolower(*attr1) == 'd' && tolower(*attr2) == 'd') {
-                       if ((ldb_attr_cmp("dn", attr1) == 0) &&
-                           (ldb_attr_cmp("distinguishedName", attr2) == 0)) {
-                               return 0;
-                       }
-                       if ((ldb_attr_cmp("dn", attr2) == 0) &&
-                           (ldb_attr_cmp("distinguishedName", attr1) == 0)) {
-                               return 0;
-                       }
+               if ((ldb_attr_cmp("dn", attr1) == 0) &&
+                   (ldb_attr_cmp("distinguishedName", attr2) == 0)) {
+                       return 0;
                }
+               if ((ldb_attr_cmp("dn", attr2) == 0) &&
+                   (ldb_attr_cmp("distinguishedName", attr1) == 0)) {
+                       return 0;
+               }
        }
        return ret;
 }

Reply via email to