You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Hindman <be...@berkeley.edu> on 2017/01/08 07:44:07 UTC

Review Request 55317: Used loop in SocketImpl.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55317/
-----------------------------------------------------------

Review request for mesos and Jie Yu.


Repository: mesos


Description
-------

Used loop in SocketImpl.


Diffs
-----

  3rdparty/libprocess/src/socket.cpp b819503095261c77f42d6f20d1a4b2b6170fb4e1 

Diff: https://reviews.apache.org/r/55317/diff/


Testing
-------

make check


Thanks,

Benjamin Hindman


Re: Review Request 55317: Used loop in SocketImpl.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55317/#review181636
-----------------------------------------------------------


Ship it!




Some more description here would be great, i.e. is this fixing a bug due to the lack of loop usage? Or is this purely a cleanup, etc.


3rdparty/libprocess/src/socket.cpp
Lines 157 (patched)
<https://reviews.apache.org/r/55317/#comment257261>

    This actually doesn't need to be a shared_ptr, you could do this:
    
    ```
    string buffer;
    
    return loop(
      None(),
      [=]() { ... };
      [=]() mutable {
        ...
        buffer.append(...);
        ...
      });
    ```
    
    Since the function will work off a single copy of the variable, this is a pretty typical pattern for working off the same variable across invocations of the lambda from what I've found.



3rdparty/libprocess/src/socket.cpp
Lines 162 (patched)
<https://reviews.apache.org/r/55317/#comment257262>

    `s/{/ {/`


- Benjamin Mahler


On Jan. 8, 2017, 7:44 a.m., Benjamin Hindman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55317/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2017, 7:44 a.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Used loop in SocketImpl.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/socket.cpp 457c5ff5e1270dd48f63c88fb99385399cc17f9f 
> 
> 
> Diff: https://reviews.apache.org/r/55317/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>