aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/immutable_constant_op_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-11-10 13:12:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-10 16:46:26 -0800
commit83c2da808e96dc5c9c3e80353d1db58a17502bf1 (patch)
tree185b741e08b55fbe8dfa07013a2fc5ef3c7797de /tensorflow/core/kernels/immutable_constant_op_test.cc
parentf157cc92a895b0cd9f5f15cc459e60ab0c98c875 (diff)
Removed StringPiece::set and StringPiece::clear, as they have no absl::string_view equivalents.
This will allow for a more convenient transition to absl::string_view. Calls to set StringPiece::set and StringPiece::clear were replaced with the StringPiece constructor as follows: string_piece_foo.set(data, size) => string_piece_foo = StringPiece(data, size) string_piece_foo.clear() => string_piece_foo = StringPiece() PiperOrigin-RevId: 175326576
Diffstat (limited to 'tensorflow/core/kernels/immutable_constant_op_test.cc')
-rw-r--r--tensorflow/core/kernels/immutable_constant_op_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/kernels/immutable_constant_op_test.cc b/tensorflow/core/kernels/immutable_constant_op_test.cc
index b318c9c79a..b3814331ee 100644
--- a/tensorflow/core/kernels/immutable_constant_op_test.cc
+++ b/tensorflow/core/kernels/immutable_constant_op_test.cc
@@ -147,8 +147,8 @@ Status CreateTempFile(Env* env, float value, uint64 size, string* filename) {
std::unique_ptr<WritableFile> file;
TF_RETURN_IF_ERROR(env->NewWritableFile(*filename, &file));
for (uint64 i = 0; i < size; ++i) {
- StringPiece sp;
- sp.set(&value, sizeof(value));
+ StringPiece sp(static_cast<char*>(static_cast<void*>(&value)),
+ sizeof(value));
TF_RETURN_IF_ERROR(file->Append(sp));
}
TF_RETURN_IF_ERROR(file->Close());