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



3rdparty/libprocess/include/process/future.hpp
<https://reviews.apache.org/r/27826/#comment102047>

    There is no value in doing this by pointer.
    
    ```
    static const std::string emptyString;
    return &emptyString;
    ```
    
    Will give you thread-save static initialization, globally addressable 
pointer, etc. Will be initialized on first call to the function / be lazily 
initialized.
    
    The function return type should be `const string *` or `const string &`. 
Currently callers could mutate the static empty string.
    
    The static should be constant (We initialize at construction then never 
change it).



3rdparty/libprocess/include/process/future.hpp
<https://reviews.apache.org/r/27826/#comment102049>

    If this return by const ref either object message field or a default empty 
string is going to be even moderately common we should pull the empty string 
into <stout/strings> and add a helper `const std::string 
&returnConstRefString(const std:string* str)` which has the null checking logic 
in it.


- Cody Maloney


On Nov. 10, 2014, 8:38 p.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27826/
> -----------------------------------------------------------
> 
> (Updated Nov. 10, 2014, 8:38 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-1694
>     https://issues.apache.org/jira/browse/MESOS-1694
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/future.hpp 
> 46ae16b0bbce79005f5ed8711be663eeeb8f4bcf 
> 
> Diff: https://reviews.apache.org/r/27826/diff/
> 
> 
> Testing
> -------
> 
> make check.
> manual review of calling code.
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>

Reply via email to