Remove some of the most blatant brain-fade in the recent guc patch
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 22 Apr 2007 03:52:40 +0000 (03:52 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
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 979cc330b1e523cd95183b1115b9756ffd29e7ea..fd0abf9e9ff065e9b624878dfc2bf9d35e0c611a 100644 (file)
@@ -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;