mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Use memcmp() rather than strncmp() when shorter string length is known.
It appears that this will be faster for all but the shortest strings; at least one some platforms, memcmp() can use word-at-a-time comparisons. Noah Misch, somewhat pared down.
This commit is contained in:
@ -1196,7 +1196,7 @@ parseNodeString(void)
|
||||
token = pg_strtok(&length);
|
||||
|
||||
#define MATCH(tokname, namelen) \
|
||||
(length == namelen && strncmp(token, tokname, namelen) == 0)
|
||||
(length == namelen && memcmp(token, tokname, namelen) == 0)
|
||||
|
||||
if (MATCH("QUERY", 5))
|
||||
return_value = _readQuery();
|
||||
|
Reference in New Issue
Block a user