[HACKERS] strange code in array_in

2011-10-29 Thread Jeff Davis
In array_in(), I see the following code: my_extra-element_type = ~element_type; It seems like it was explicitly changed from InvalidOid to ~element_type. At first I thought it was a mistake, but then I thought maybe it was to ensure that the next branch was taken even if element_type ==

Re: [HACKERS] strange code in array_in

2011-10-29 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: In array_in(), I see the following code: my_extra-element_type = ~element_type; It seems like it was explicitly changed from InvalidOid to ~element_type. At first I thought it was a mistake, but then I thought maybe it was to ensure that the next branch

Re: [HACKERS] strange code in array_in

2011-10-29 Thread Jeff Davis
On Sat, 2011-10-29 at 15:13 -0400, Tom Lane wrote: What other lookups? I just meant anything after that point in the function would surely fail (get_type_io_data). array_out, and I believe a bunch of other places, use the same trick. OK. In retrospect it is a very simple trick, but at the