mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 68197: Added move support for `class Resources`.
Date Tue, 07 Aug 2018 02:17:08 GMT

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




src/common/resources.cpp
Lines 2046-2051 (patched)
<https://reviews.apache.org/r/68197/#comment290072>

    Just realized that the following would be more efficient:
    
    ```
    Resources Resources::operator+(Resources&& that) const
    {
      Resources result = std::move(that);
      result += *this;
      return result;
    }
    ```
    
    That way we move then add instead of copy then add; if the resource names are the same
(which is usually the case) then this is helpful.


- Benjamin Mahler


On Aug. 6, 2018, 11:15 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68197/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2018, 11:15 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9110
>     https://issues.apache.org/jira/browse/MESOS-9110
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 21aaf0d512bb74aa08398c9aa432f53fffdd3ff0 
>   include/mesos/v1/resources.hpp 2f9c704e92d00f55231272fd1ff5654ee8f69eec 
>   src/common/resources.cpp 253b8bcd720e38f485b5cd2f5b7666ac85e67d38 
>   src/v1/resources.cpp ab8fc3e738038b9b34d4902aed9f15a59b416217 
> 
> 
> Diff: https://reviews.apache.org/r/68197/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message