Re: Remove post-increment in function quote_identifier of pg_upgrade
От | Tom Lane |
---|---|
Тема | Re: Remove post-increment in function quote_identifier of pg_upgrade |
Дата | |
Msg-id | 2988103.1619707865@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Remove post-increment in function quote_identifier of pg_upgrade (Justin Pryzby <pryzby@telsasoft.com>) |
Список | pgsql-hackers |
Justin Pryzby <pryzby@telsasoft.com> writes: > On Thu, Apr 29, 2021 at 06:35:28PM +0530, Vaibhav Dalvi wrote: >> If my understanding is correct then '++' is not needed in the >> above highlighted statement which is leading to overhead. > I don't think the integer increment during pg_upgrade is a meaningful overhead. > You could check the compiler's assembly output it may be the same even without > the ++. Yeah: if the increment actually costs something, I'd expect the compiler to optimize it away. But on a lot of machine architectures, a pointer post-increment is basically free anyhow. > I'd suggest to leave it as it's currently written, since the idiom on every > other line is *r++ = ..., it'd be strange to write it differently here, and > could end up being confusing or copied+pasted somewhere else. I agree --- cosmetically, this change isn't an improvement. (On the other hand, if it were written the other way already, I'd also argue to leave it like that. Basically, this sort of change is just not worth troubling over. It doesn't improve things meaningfully and it creates back-patching hazards.) regards, tom lane
В списке pgsql-hackers по дате отправления: