From 0fa128bbd0a53a3428fa2028b8754e15c9ef7c38 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Sat, 20 Sep 2014 17:17:49 -0400 Subject: base: Clean up redundant string functions and use C++11 This patch does a bit of housekeeping on the string helper functions and relies on the C++11 standard library where possible. It also does away with our custom string hash as an implementation is already part of the standard library. --- src/base/stats/text.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/base/stats') diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index 2c5b004be..efe43c602 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -284,7 +284,7 @@ VectorPrint::operator()(std::ostream &stream) const // the case where there are no subnames) and append it to the // base name. if (forceSubnames) - print.name = base + (havesub ? subnames[0] : to_string(0)); + print.name = base + (havesub ? subnames[0] : std::to_string(0)); print.value = vec[0]; print(stream); return; @@ -300,7 +300,7 @@ VectorPrint::operator()(std::ostream &stream) const if (havesub && (i >= subnames.size() || subnames[i].empty())) continue; - print.name = base + (havesub ? subnames[i] : to_string(i)); + print.name = base + (havesub ? subnames[i] : std::to_string(i)); print.desc = subdescs.empty() ? desc : subdescs[i]; print.update(vec[i], _total); @@ -355,7 +355,7 @@ DistPrint::DistPrint(const Text *text, const VectorDistInfo &info, int i) init(text, info); name = info.name + "_" + - (info.subnames[i].empty() ? (to_string(i)) : info.subnames[i]); + (info.subnames[i].empty() ? (std::to_string(i)) : info.subnames[i]); if (!info.subdescs[i].empty()) desc = info.subdescs[i]; @@ -605,7 +605,7 @@ Text::visit(const Vector2dInfo &info) } print.name = info.name + "_" + - (havesub ? info.subnames[i] : to_string(i)); + (havesub ? info.subnames[i] : std::to_string(i)); print.desc = info.desc; print.vec = yvec; print.total = total; -- cgit v1.2.3