| От | Tom Lane |
|---|---|
| Тема | Re: [PATCHES] Bad bug in fopen() wrapper code |
| Дата | |
| Msg-id | 24827.1159883943@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [PATCHES] Bad bug in fopen() wrapper code ("Zeugswetter Andreas DCP SD" <ZeugswetterA@spardat.at>) |
| Список | pgsql-hackers |
"Zeugswetter Andreas DCP SD" <ZeugswetterA@spardat.at> writes:
> "If successful, _setmode returns the previous translation mode. A return
> value of -1 indicates an error"
> So, shouldn't we be testing for -1 instead of < 0 ?
I think the usual convention is to test for < 0, unless there are other
negative return values that are legal. This is doubtless a silly
cycle-shaving habit (on nearly all machines, test against 0 is a bit
more compact than test against other constants), but it is a widespread
habit anyway, and if you sometimes do it one way and sometimes another
you just create a distraction for readers.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера