On 17.04.24 23:39, Andres Freund wrote:
Is there some reason we went for this pattern in a fair number of places? I assume it's mostly copy-pasta, but...
Right. I don't think it is commonly understood that adding const qualifiers can help compiler optimization, and it's difficult to systematically check for omissions or verify the optimization effects. So I think we just have to keep trying to do our best manually for now.
Attached are fixes for struct option and a few more occurrences I've found with a bit of grepping.
These look good to me.