mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaston Kleiman <gas...@mesosphere.io>
Subject Re: Review Request 64618: Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.
Date Wed, 14 Mar 2018 23:50:55 GMT


> On March 13, 2018, 4:19 p.m., Greg Mann wrote:
> > src/master/master.cpp
> > Lines 5960 (patched)
> > <https://reviews.apache.org/r/64618/diff/6/?file=1974232#file1974232line5961>
> >
> >     Can we move this to?
> >     
> >     `std::move(statusUuid.toBytes())`
> >     
> >     Looks like `toBytes()` returns a `std::string` and `set_value` has an overload
for rvalue reference, so I think we can avoid a copy here if we move?
> 
> Gaston Kleiman wrote:
>     Since `statusUuid.toBytes()` here is an rvalue, I think that `set_value(std::string&&)`
should be automatically used. I updated the patch anyway for the sake of explicitness/readability.

Well.. I just noticed that adding `std::move` breaks the build, so I reverted that part. Here's
the error that it triggers:

```
master/master.cpp:6006:44: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  message.mutable_status_uuid()->set_value(std::move(statusUuid.toBytes()));
                                           ^
../../src/master/master.cpp:6006:44: note: remove std::move call here
  message.mutable_status_uuid()->set_value(std::move(statusUuid.toBytes()));
                                           ^~~~~~~~~~                    ~
```


- Gaston


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


On March 14, 2018, 4:50 p.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64618/
> -----------------------------------------------------------
> 
> (Updated March 14, 2018, 4:50 p.m.)
> 
> 
> Review request for mesos and Greg Mann.
> 
> 
> Bugs: MESOS-8184
>     https://issues.apache.org/jira/browse/MESOS-8184
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp cf03d8bf7df583c849a3b2a326d3772820181b0f 
>   src/master/master.hpp 8bf2c763dafdb7df55c46a56f2ff66f2a951d947 
>   src/master/master.cpp 223ebf29ac4dd1dea9080e4bef4b2d4d064d847f 
> 
> 
> Diff: https://reviews.apache.org/r/64618/diff/8/
> 
> 
> Testing
> -------
> 
> `make check` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>


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