Re: Minor code de-duplication in fe-connect.c

2023-04-24 Thread Gurjeet Singh
On Mon, Apr 24, 2023 at 5:14 AM Daniel Gustafsson wrote: > > On 21 Apr 2023, at 18:38, Gurjeet Singh wrote: > > > > On Fri, Apr 21, 2023 at 7:47 AM Robert Haas > wrote: > >> > >> On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson > wrote: > >>> The reason I left it like this when reviewing and

Re: Minor code de-duplication in fe-connect.c

2023-04-24 Thread Daniel Gustafsson
> On 21 Apr 2023, at 18:38, Gurjeet Singh wrote: > > On Fri, Apr 21, 2023 at 7:47 AM Robert Haas wrote: >> >> On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson wrote: >>> The reason I left it like this when reviewing and committing is that I >>> think it >>> makes for more readable code. The

Re: Minor code de-duplication in fe-connect.c

2023-04-21 Thread Gurjeet Singh
On Fri, Apr 21, 2023 at 7:47 AM Robert Haas wrote: > > On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson wrote: > > The reason I left it like this when reviewing and committing is that I > > think it > > makes for more readable code. The amount of lines saved is pretty small, > > and > > "shuf

Re: Minor code de-duplication in fe-connect.c

2023-04-21 Thread Robert Haas
On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson wrote: > The reason I left it like this when reviewing and committing is that I think > it > makes for more readable code. The amount of lines saved is pretty small, and > "shuffle" isn't an exact term so by reading the code it isn't immediate cl

Re: Minor code de-duplication in fe-connect.c

2023-04-21 Thread Daniel Gustafsson
> On 21 Apr 2023, at 07:29, Gurjeet Singh wrote: > > Commit [1] implements Fisher-Yates shuffling algorithm to shuffle > connection addresses, in two places. > > The attached patch moves the duplicated code to a function, and calls > it in those 2 places. The reason I left it like this when rev

Minor code de-duplication in fe-connect.c

2023-04-20 Thread Gurjeet Singh
Commit [1] implements Fisher-Yates shuffling algorithm to shuffle connection addresses, in two places. The attached patch moves the duplicated code to a function, and calls it in those 2 places. [1]: Support connection load balancing in libpq 7f5b19817eaf38e70ad1153db4e644ee9456853e Best regards