You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2017/03/03 03:03:14 UTC
kudu git commit: [util] conventional signature for Status::operator=()
Repository: kudu
Updated Branches:
refs/heads/master 28e9349fb -> 7c108db64
[util] conventional signature for Status::operator=()
Updated the signature of the Status::operator=() to be more
conventional. This fixes TidyBot's warning from
https://gerrit.cloudera.org/#/c/6174/1/src/kudu/util/status.h@403
Change-Id: If04674c88d97204d52bcc15a40755d556f309ea1
Reviewed-on: http://gerrit.cloudera.org:8080/6175
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7c108db6
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7c108db6
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7c108db6
Branch: refs/heads/master
Commit: 7c108db640753927b8ec5c98087144051437ea98
Parents: 28e9349
Author: Alexey Serbin <as...@cloudera.com>
Authored: Mon Feb 27 19:03:33 2017 -0800
Committer: Alexey Serbin <as...@cloudera.com>
Committed: Fri Mar 3 03:01:54 2017 +0000
----------------------------------------------------------------------
src/kudu/util/status.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/7c108db6/src/kudu/util/status.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/status.h b/src/kudu/util/status.h
index aaa5427..93a25a6 100644
--- a/src/kudu/util/status.h
+++ b/src/kudu/util/status.h
@@ -144,7 +144,8 @@ class KUDU_EXPORT Status {
///
/// @param [in] s
/// The status object to assign from.
- void operator=(const Status& s);
+ /// @return The reference to the modified object.
+ Status& operator=(const Status& s);
#if __cplusplus >= 201103L
/// Move the specified status (C++11).
@@ -157,7 +158,8 @@ class KUDU_EXPORT Status {
///
/// @param [in] s
/// rvalue reference to a Status object.
- void operator=(Status&& s);
+ /// @return The reference to the modified object.
+ Status& operator=(Status&& s);
#endif
/// @return A success status.
@@ -400,13 +402,15 @@ class KUDU_EXPORT Status {
inline Status::Status(const Status& s) {
state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
}
-inline void Status::operator=(const Status& s) {
+
+inline Status& Status::operator=(const Status& s) {
// The following condition catches both aliasing (when this == &s),
// and the common case where both s and *this are OK.
if (state_ != s.state_) {
delete[] state_;
state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
}
+ return *this;
}
#if __cplusplus >= 201103L
@@ -414,12 +418,13 @@ inline Status::Status(Status&& s) : state_(s.state_) {
s.state_ = nullptr;
}
-inline void Status::operator=(Status&& s) {
+inline Status& Status::operator=(Status&& s) {
if (state_ != s.state_) {
delete[] state_;
state_ = s.state_;
s.state_ = nullptr;
}
+ return *this;
}
#endif