diff options
author | 2017-11-10 13:12:49 -0800 | |
---|---|---|
committer | 2017-11-10 16:46:26 -0800 | |
commit | 83c2da808e96dc5c9c3e80353d1db58a17502bf1 (patch) | |
tree | 185b741e08b55fbe8dfa07013a2fc5ef3c7797de /tensorflow/contrib/android | |
parent | f157cc92a895b0cd9f5f15cc459e60ab0c98c875 (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/contrib/android')
-rw-r--r-- | tensorflow/contrib/android/asset_manager_filesystem.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/android/asset_manager_filesystem.cc b/tensorflow/contrib/android/asset_manager_filesystem.cc index 9e4d3290c3..380a652435 100644 --- a/tensorflow/contrib/android/asset_manager_filesystem.cc +++ b/tensorflow/contrib/android/asset_manager_filesystem.cc @@ -97,7 +97,7 @@ class RandomAccessFileFromAsset : public RandomAccessFile { off64_t new_offset = AAsset_seek64(asset.get(), offset, SEEK_SET); off64_t length = AAsset_getLength64(asset.get()); if (new_offset < 0) { - result->set(scratch, 0); + *result = StringPiece(scratch, 0); return errors::OutOfRange("Read after file end."); } const off64_t region_left = @@ -106,7 +106,7 @@ class RandomAccessFileFromAsset : public RandomAccessFile { if (read < 0) { return errors::Internal("Error reading from asset."); } - result->set(scratch, region_left); + *result = StringPiece(scratch, region_left); return (region_left == to_read) ? Status::OK() : errors::OutOfRange("Read less bytes than requested."); |