aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/strings/str_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/lib/strings/str_util.cc')
-rw-r--r--tensorflow/core/lib/strings/str_util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/lib/strings/str_util.cc b/tensorflow/core/lib/strings/str_util.cc
index 4598b8ccc7..cab8f81585 100644
--- a/tensorflow/core/lib/strings/str_util.cc
+++ b/tensorflow/core/lib/strings/str_util.cc
@@ -332,7 +332,7 @@ string StringReplace(StringPiece s, StringPiece oldsub, StringPiece newsub,
bool replace_all) {
// TODO(jlebar): We could avoid having to shift data around in the string if
// we had a StringPiece::find() overload that searched for a StringPiece.
- string res = s.ToString();
+ string res = std::string(s);
size_t pos = 0;
while ((pos = res.find(oldsub.data(), pos, oldsub.size())) != string::npos) {
res.replace(pos, oldsub.size(), newsub.data(), newsub.size());
@@ -449,7 +449,7 @@ bool SplitAndParseAsFloats(StringPiece text, char delim,
return SplitAndParseAsInts<float>(text, delim,
[](StringPiece str, float* value) {
return strings::safe_strtof(
- str.ToString().c_str(), value);
+ std::string(str).c_str(), value);
},
result);
}