kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [2/5] incubator-kudu git commit: block_handle: use c++11 move instead of emulated move
Date Tue, 23 Feb 2016 00:10:54 GMT
block_handle: use c++11 move instead of emulated move

Change-Id: I54b5a128654a1485e5173bab7a5fe0a0067b2572
Reviewed-on: http://gerrit.cloudera.org:8080/2245
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <dan@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/ff362669
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/ff362669
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/ff362669

Branch: refs/heads/master
Commit: ff3626697cc71e6e3579daf80faa97b2488f976e
Parents: 86f9228
Author: Todd Lipcon <todd@apache.org>
Authored: Thu Feb 18 21:24:55 2016 -0800
Committer: Todd Lipcon <todd@apache.org>
Committed: Tue Feb 23 00:09:57 2016 +0000

----------------------------------------------------------------------
 src/kudu/cfile/block_handle.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/ff362669/src/kudu/cfile/block_handle.h
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/block_handle.h b/src/kudu/cfile/block_handle.h
index 0c34e41..f4e48cb 100644
--- a/src/kudu/cfile/block_handle.h
+++ b/src/kudu/cfile/block_handle.h
@@ -29,7 +29,6 @@ namespace cfile {
 // they stop being used. In the case that they didn't come from cache, we need to actually
free
 // the underlying data.
 class BlockHandle {
-  MOVE_ONLY_TYPE_FOR_CPP_03(BlockHandle, RValue);
  public:
   static BlockHandle WithOwnedData(const Slice& data) {
     return BlockHandle(data);
@@ -43,12 +42,12 @@ class BlockHandle {
   BlockHandle()
     : is_data_owner_(false) { }
 
-  // Emulated Move constructor
-  BlockHandle(RValue other) { // NOLINT(runtime/explicit)
-    TakeState(other.object);
+  // Move constructor and assignment
+  BlockHandle(BlockHandle&& other) {
+    TakeState(&other);
   }
-  BlockHandle& operator=(RValue other) {
-    TakeState(other.object);
+  BlockHandle& operator=(BlockHandle&& other) {
+    TakeState(&other);
     return *this;
   }
 
@@ -90,6 +89,8 @@ class BlockHandle {
       dblk_data_.swap(&other->dblk_data_);
     }
   }
+
+  DISALLOW_COPY_AND_ASSIGN(BlockHandle);
 };
 
 } // namespace cfile


Mime
View raw message