diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-08-22 12:09:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-22 12:12:38 -0700 |
commit | 36e475ce4d0a3565a81329641e2a95152eb9ebc6 (patch) | |
tree | 37011a00288bc7a30d7ed0eadb6775e50318de61 /tensorflow/core/platform | |
parent | 8f2f9eb49813568b6a7b6a1fa7480e961f7b8c9a (diff) |
Replaced calls to tensorflow::StringPiece::ToString with string conversions.
That is, instances of sp.ToString() are replaced with string(sp).
This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view.
PiperOrigin-RevId: 209806694
Diffstat (limited to 'tensorflow/core/platform')
-rw-r--r-- | tensorflow/core/platform/hadoop/hadoop_file_system.cc | 6 | ||||
-rw-r--r-- | tensorflow/core/platform/posix/posix_file_system.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/core/platform/hadoop/hadoop_file_system.cc b/tensorflow/core/platform/hadoop/hadoop_file_system.cc index ff4b4436bb..8cdb08f51b 100644 --- a/tensorflow/core/platform/hadoop/hadoop_file_system.cc +++ b/tensorflow/core/platform/hadoop/hadoop_file_system.cc @@ -144,7 +144,7 @@ Status HadoopFileSystem::Connect(StringPiece fname, hdfsFS* fs) { StringPiece scheme, namenode, path; io::ParseURI(fname, &scheme, &namenode, &path); - const string nn = namenode.ToString(); + const string nn(namenode); hdfsBuilder* builder = hdfs_->hdfsNewBuilder(); if (scheme == "file") { @@ -183,7 +183,7 @@ Status HadoopFileSystem::Connect(StringPiece fname, hdfsFS* fs) { string HadoopFileSystem::TranslateName(const string& name) const { StringPiece scheme, namenode, path; io::ParseURI(name, &scheme, &namenode, &path); - return path.ToString(); + return string(path); } class HDFSRandomAccessFile : public RandomAccessFile { @@ -392,7 +392,7 @@ Status HadoopFileSystem::GetChildren(const string& dir, return IOError(dir, errno); } for (int i = 0; i < entries; i++) { - result->push_back(io::Basename(info[i].mName).ToString()); + result->push_back(string(io::Basename(info[i].mName))); } hdfs_->hdfsFreeFileInfo(info, entries); return Status::OK(); diff --git a/tensorflow/core/platform/posix/posix_file_system.h b/tensorflow/core/platform/posix/posix_file_system.h index e8898d0a97..752eccea66 100644 --- a/tensorflow/core/platform/posix/posix_file_system.h +++ b/tensorflow/core/platform/posix/posix_file_system.h @@ -70,7 +70,7 @@ class LocalPosixFileSystem : public PosixFileSystem { string TranslateName(const string& name) const override { StringPiece scheme, host, path; io::ParseURI(name, &scheme, &host, &path); - return path.ToString(); + return string(path); } }; |