[PATCH] Use strchr() to search for a single character - Mailing list pgsql-hackers

From Dmitry Mityugov
Subject [PATCH] Use strchr() to search for a single character
Date
Msg-id 9c1beea6c7a5e9fb6677f26620f1f257@postgrespro.ru
Whole thread Raw
List pgsql-hackers
Code in src/port/pgmkdirp.c uses strstr() to find a single character in 
a string, but strstr() seems to be too generic for this job. Another 
function, strchr(), might be better suited for this purpose, because it 
is optimized to search for exactly one character in a string. In 
addition, if strchr() is used, the compiler doesn't have to generate a 
terminating \0 byte for the substring, producing slightly smaller code. 
I'm attaching the patch.

Regards,
Dmitry
Attachment

pgsql-hackers by date:

Previous
From: Rishu Bagga
Date:
Subject: Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput
Next
From: Robert Treat
Date:
Subject: Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX