From 3c01aa2b00ee4c3fda412b23da39fd0894c04cf7 Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Fri, 28 Sep 2018 17:04:06 -0700 Subject: Bunch of micro move optimizations PiperOrigin-RevId: 215018984 --- tensorflow/core/framework/op.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tensorflow/core/framework/op.h') diff --git a/tensorflow/core/framework/op.h b/tensorflow/core/framework/op.h index 25f8de8dcc..81ed5f95f0 100644 --- a/tensorflow/core/framework/op.h +++ b/tensorflow/core/framework/op.h @@ -209,16 +209,16 @@ template <> class OpDefBuilderWrapper { public: OpDefBuilderWrapper(const char name[]) : builder_(name) {} - OpDefBuilderWrapper& Attr(StringPiece spec) { - builder_.Attr(spec); + OpDefBuilderWrapper& Attr(string spec) { + builder_.Attr(std::move(spec)); return *this; } - OpDefBuilderWrapper& Input(StringPiece spec) { - builder_.Input(spec); + OpDefBuilderWrapper& Input(string spec) { + builder_.Input(std::move(spec)); return *this; } - OpDefBuilderWrapper& Output(StringPiece spec) { - builder_.Output(spec); + OpDefBuilderWrapper& Output(string spec) { + builder_.Output(std::move(spec)); return *this; } OpDefBuilderWrapper& SetIsCommutative() { @@ -237,12 +237,12 @@ class OpDefBuilderWrapper { builder_.SetAllowsUninitializedInput(); return *this; } - OpDefBuilderWrapper& Deprecated(int version, StringPiece explanation) { - builder_.Deprecated(version, explanation); + OpDefBuilderWrapper& Deprecated(int version, string explanation) { + builder_.Deprecated(version, std::move(explanation)); return *this; } - OpDefBuilderWrapper& Doc(StringPiece text) { - builder_.Doc(text); + OpDefBuilderWrapper& Doc(string text) { + builder_.Doc(std::move(text)); return *this; } OpDefBuilderWrapper& SetShapeFn( -- cgit v1.2.3