This is an automated email from the ASF dual-hosted git repository.
mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 98597ed Replaced `.get().get()` with `**` in `result.hpp`.
98597ed is described below
commit 98597edb0eaf4ac7c1227c4573a9f005c7d55342
Author: Meng Zhu <[email protected]>
AuthorDate: Tue Mar 12 17:46:37 2019 -0700
Replaced `.get().get()` with `**` in `result.hpp`.
Besides readability, this also avoids the lint warning.
Review: https://reviews.apache.org/r/70199
---
3rdparty/stout/include/stout/result.hpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/3rdparty/stout/include/stout/result.hpp
b/3rdparty/stout/include/stout/result.hpp
index d5dbf6c..eacf1a2 100644
--- a/3rdparty/stout/include/stout/result.hpp
+++ b/3rdparty/stout/include/stout/result.hpp
@@ -132,7 +132,7 @@ private:
// This is made static to decouple us from the `const` qualifier of `this`.
template <typename Self>
static auto get(Self&& self)
- -> decltype(std::forward<Self>(self).data.get().get())
+ -> decltype(**(std::forward<Self>(self).data))
{
if (!self.isSome()) {
std::string errorMessage = "Result::get() but state == ";
@@ -143,8 +143,7 @@ private:
}
ABORT(errorMessage);
}
- // NOLINTNEXTLINE(mesos-redundant-get)
- return std::forward<Self>(self).data.get().get();
+ return **(std::forward<Self>(self).data);
}
// We leverage Try<Option<T>> to avoid dynamic allocation of T. This