You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/06/28 12:48:31 UTC

[arrow] branch master updated: ARROW-5770: [C++] Fix -Wpessimizing-move in result.h

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c8097a  ARROW-5770: [C++] Fix -Wpessimizing-move in result.h
5c8097a is described below

commit 5c8097ac39f8c1e2e902a75433c16ed7f701ebf9
Author: Micah Kornfield <em...@gmail.com>
AuthorDate: Fri Jun 28 07:48:24 2019 -0500

    ARROW-5770: [C++] Fix -Wpessimizing-move in result.h
    
    Author: Micah Kornfield <em...@gmail.com>
    
    Closes #4733 from emkornfield/remove_std_move and squashes the following commits:
    
    ad1b1fc99 <Micah Kornfield> ARROW-5770: Fix -Wpessimizing-move in result.h
---
 cpp/src/arrow/result.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/result.h b/cpp/src/arrow/result.h
index c1fbd0a..36e6ef7 100644
--- a/cpp/src/arrow/result.h
+++ b/cpp/src/arrow/result.h
@@ -280,9 +280,9 @@ class Result {
     }
     T tmp(std::move(arrow::util::get<T>(variant_)));
     variant_ = "Object already returned with ValueOrDie";
-    return std::move(tmp);
+    return tmp;
   }
-  T operator*() && { return std::move(ValueOrDie()); }
+  T operator*() && { return ValueOrDie(); }
 
  private:
   // Assignment is disabled by default so we need to destruct/reconstruct