Re: [PATCH] Add function to_oct
От | Dag Lem |
---|---|
Тема | Re: [PATCH] Add function to_oct |
Дата | |
Msg-id | 167170369754.1121.7881078512513671914.pgcf@coridan.postgresql.org обсуждение исходный текст |
Ответ на | Re: [PATCH] Add function to_oct (Ian Lawrence Barwick <barwick@gmail.com>) |
Ответы |
Re: [PATCH] Add function to_oct
|
Список | pgsql-hackers |
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation: not tested This is a mini-review of to_oct :-) The function seems useful to me, and is obviously correct. I don't know whether optimization at such a low level is considered in PostgreSQL, but here goes. The calculation of quotient and remainder can be replaced by less costly masking and shifting. Defining #define OCT_DIGIT_BITS 3 #define OCT_DIGIT_BITMASK 0x7 the content of the loop can be replaced by *--ptr = digits[value & OCT_DIGIT_BITMASK]; value >>= OCT_DIGIT_BITS; Also, the check for ptr > buf in the while loop can be removed. The check is superfluous, since buf cannot possibly be exhaustedby a 32 bit integer (the maximum octal number being 37777777777). Best regards Dag Lem The new status of this patch is: Waiting on Author
В списке pgsql-hackers по дате отправления: