Re: [PATCH] PSC callback cleanup

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Wed, 02 Apr 2014 17:37:15 -0600

On 04/02/2014 05:03 AM, Amos Jeffries wrote:
> This removes the needless Comm::ConnectionList* parameter to the PSC
> (Peer Select callback) function.
>
> The callee state object (data) of PSC is the original owner of the
> vector "list" being returned so always has direct access to it as a
> member variable.

I would go the other way around if possible: Make peer selection code
return the computed destinations list to the caller instead of
maintaining that destination list as a _shared_ storage object between
the caller and the peer selection code.

In other words, instead of removing Comm::ConnectionList* parameter from
the Peer Select callback, I would remove it from the peerSelect() call
itself (if possible).

If peerSelect() needs an initial set of destinations for some reason,
then both parameters should stay, but there should be no sharing of
those two lists (and they can/should be converted from pointers to
references in this case).

HTH,

Alex.
Received on Wed Apr 02 2014 - 23:37:43 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 03 2014 - 12:00:09 MDT