提交 dbcd9d61 编写于 作者: T Tom Lane

Remove some of the most blatant brain-fade in the recent guc patch

(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?
上级 afcf09dd
......@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* 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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册