Remove some of the most blatant brain-fade in the recent guc patch
authorTom Lane
Sun, 22 Apr 2007 03:52:40 +0000 (03:52 +0000)
committerTom Lane
Sun, 22 Apr 2007 03:52:40 +0000 (03:52 +0000)
(it's so nice to have a buildfarm member that actively rejects naked
uses of strcasecmp).  This coding is still pretty awful, though, since
it's going to be O(N^2) in the number of guc variables.  May I direct
your attention to bsearch?

src/backend/utils/misc/guc.c

index 8b1122d86e2ff1c491b0dcf47493b1c79611e65d..9b1e813dc6c3d3859db70fbfa234e85099a26189 100644 (file)
@@ -10,7 +10,7 @@
  * Written by Peter Eisentraut .
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.387 2007/04/21 20:02:40 petere Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.388 2007/04/22 03:52:40 tgl Exp $
  *
  *--------------------------------------------------------------------
  */
@@ -2681,7 +2681,7 @@ guc_get_index(const char *name)
    int i;
 
    for (i = 0; i < num_guc_variables; i++)
-       if (strcasecmp(name, guc_variables[i]->name) == 0)
+       if (guc_name_compare(name, guc_variables[i]->name) == 0)
            return i;
 
    return -1;