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



include/mesos/values.hpp (line 21)
<https://reviews.apache.org/r/38158/#comment154497>

    ```
    #include <algorithm>
    #include <set>
    ```



include/mesos/values.hpp (lines 58 - 59)
<https://reviews.apache.org/r/38158/#comment154494>

    Empty line, please.



src/common/values.cpp (line 91)
<https://reviews.apache.org/r/38158/#comment154495>

    s/Remove/Removes
    s/indexes/indices
    
    Mind refining a comment a bit? It looks like it evolved during time and 
contains artifacts from previous versions : ).



src/common/values.cpp (line 95)
<https://reviews.apache.org/r/38158/#comment154496>

    I would pass set by pointer here to explicitly document that it may be 
changed in the function. In that case the caller will have to `&deleteSet` 
which hopefully make them look closer to the signature. Also, let's mention 
that in the comment.



src/common/values.cpp (line 105)
<https://reviews.apache.org/r/38158/#comment154498>

    `nextRemove` cannot be greater than `nextElement`, because you do 
`deleteSet.insert(nextElement);` at the end. The only exception is the first 
iteration. How about initializing `nextElement = *deleteSet.begin() + 1` and 
remove this line?



src/common/values.cpp (line 136)
<https://reviews.apache.org/r/38158/#comment154500>

    s/next/nested ?



src/common/values.cpp (lines 157 - 178)
<https://reviews.apache.org/r/38158/#comment154501>

    I think we can conflate this two cases, how about this:
    ```
    if (range->end() + 1 >= current.begin()) {
      range->set_end(std::max(range.end(), current.end()));
      deleteSet.insert(y);
      ++i;
    } else {
      break;
    }
    ```



src/common/values.cpp (lines 268 - 273)
<https://reviews.apache.org/r/38158/#comment154502>

    Can we insert a new range into an appropriate position? This should be 
`O(n)` instead of `O(n log n)`


- Alexander Rukletsov


On Sept. 8, 2015, 7:25 p.m., Joerg Schad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38158/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2015, 7:25 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske and Till Toenshoff.
> 
> 
> Bugs: MESOS-3051
>     https://issues.apache.org/jira/browse/MESOS-3051
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The goal of this refactoring was to reuse the Ranges objects as much as 
> possible, as prior there was substantial time spend in allocation/destruction 
> (MESOS-3051).
> 
> 
> Diffs
> -----
> 
>   include/mesos/values.hpp e300580431f7fd6cff06e9617c0227b51c4cb8e2 
>   src/common/values.cpp 750264e603b4cde2011f07f4434a4b34fe3e512f 
>   src/tests/resources_tests.cpp 2ae93a9c8235e5e4643539d409df51c39c6d7e56 
>   src/tests/values_tests.cpp fc35d97894a2de6207b9337180e2160e6f2cb1f5 
> 
> Diff: https://reviews.apache.org/r/38158/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>

Reply via email to