Re: [HACKERS] Small patch: fix code duplication in heapam.c

2016-03-25 Thread Aleksander Alekseev
> I think this is a waste of time. These functions are already very > short; making them shorter will not significantly improve readability. > It'll just force people who think they know what that code does to > look at it again to see if it still does the same thing. > > Let's spend our time

Re: [HACKERS] Small patch: fix code duplication in heapam.c

2016-03-25 Thread Robert Haas
On Thu, Mar 24, 2016 at 11:35 AM, Aleksander Alekseev wrote: > In the same time I'm deeply convinced that this patch will make code > more readable at least because it makes code much shorter: I think this is a waste of time. These functions are already very short;

Re: [HACKERS] Small patch: fix code duplication in heapam.c

2016-03-24 Thread Aleksander Alekseev
> All that code is hotspot stuff, and turning it into a pile of nested > procedures doesn't seem like it improves either performance or > readability. Your concern regarding performance is understandable. But I should note that any standard compiler supports inlining these days (probably this

Re: [HACKERS] Small patch: fix code duplication in heapam.c

2016-03-24 Thread Tom Lane
Aleksander Alekseev writes: > I discovered that there is a lot of code duplication in heapam.c. > In particular relation_openrv and relation_openrv_extended procedures > and also heap_openrv and heap_openrv_extended procedures are almost the > same. Here is a patch that

[HACKERS] Small patch: fix code duplication in heapam.c

2016-03-24 Thread Aleksander Alekseev
Hello I discovered that there is a lot of code duplication in heapam.c. In particular relation_openrv and relation_openrv_extended procedures and also heap_openrv and heap_openrv_extended procedures are almost the same. Here is a patch that fixes this. -- Best regards, Aleksander Alekseev