Skip to content

Commit

Permalink
MesosTidy [misc-use-after-move]: Added NOLINT to false-positives.
Browse files Browse the repository at this point in the history
```
3rdparty/libprocess/src/../include/process/future.hpp:1187:5: warning:
'callback' used after it was moved [misc-use-after-move]
    callback();
    ^
3rdparty/libprocess/src/../include/process/future.hpp:1181:32: note:
move occurred here
      data->onDiscardCallbacks.emplace_back(std::move(callback));
                               ^
```

Review: https://reviews.apache.org/r/63932
  • Loading branch information
mpark committed Nov 21, 2017
1 parent 6026b80 commit 56c9ff4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions 3rdparty/libprocess/include/process/future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ const Future<T>& Future<T>::onAbandoned(AbandonedCallback&& callback) const

// TODO(*): Invoke callback in another execution context.
if (run) {
callback();
callback(); // NOLINT(misc-use-after-move)
}

return *this;
Expand All @@ -1351,7 +1351,7 @@ const Future<T>& Future<T>::onDiscard(DiscardCallback&& callback) const

// TODO(*): Invoke callback in another execution context.
if (run) {
callback();
callback(); // NOLINT(misc-use-after-move)
}

return *this;
Expand All @@ -1373,7 +1373,7 @@ const Future<T>& Future<T>::onReady(ReadyCallback&& callback) const

// TODO(*): Invoke callback in another execution context.
if (run) {
callback(data->result.get());
callback(data->result.get()); // NOLINT(misc-use-after-move)
}

return *this;
Expand All @@ -1395,7 +1395,7 @@ const Future<T>& Future<T>::onFailed(FailedCallback&& callback) const

// TODO(*): Invoke callback in another execution context.
if (run) {
callback(data->result.error());
callback(data->result.error()); // NOLINT(misc-use-after-move)
}

return *this;
Expand Down Expand Up @@ -1439,7 +1439,7 @@ const Future<T>& Future<T>::onAny(AnyCallback&& callback) const

// TODO(*): Invoke callback in another execution context.
if (run) {
callback(*this);
callback(*this); // NOLINT(misc-use-after-move)
}

return *this;
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libprocess/src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ bool Pipe::Writer::write(string s)
// NOTE: We set the promise outside the critical section to avoid
// triggering callbacks that try to reacquire the lock.
if (read.get() != nullptr) {
read->set(std::move(s));
read->set(std::move(s)); // NOLINT(misc-use-after-move)
}

return written;
Expand Down

0 comments on commit 56c9ff4

Please sign in to comment.