Fix all remaining StrAppend -> absl::StrAppend

This commit is contained in:
Corentin Le Molgat
2018-06-01 17:31:36 +02:00
committed by Mizux Seiha
parent 8430b64c61
commit 7dda497960
3 changed files with 9 additions and 9 deletions

View File

@@ -147,11 +147,11 @@ void Tsp() {
std::string route;
for (int64 node = routing.Start(route_number); !routing.IsEnd(node);
node = solution->Value(routing.NextVar(node))) {
StrAppend(&route, routing.IndexToNode(node).value(), " (", node,
absl::StrAppend(&route, routing.IndexToNode(node).value(), " (", node,
") -> ");
}
const int64 end = routing.End(route_number);
StrAppend(&route, routing.IndexToNode(end).value(), " (", end, ")");
absl::StrAppend(&route, routing.IndexToNode(end).value(), " (", end, ")");
LOG(INFO) << route;
} else {
LOG(INFO) << "No solution found.";

View File

@@ -2505,21 +2505,21 @@ class RevPartialSequence {
std::string DebugString() const {
std::string result = "[";
for (int i = 0; i < first_ranked_.Value(); ++i) {
StrAppend(&result, elements_[i]);
absl::StrAppend(&result, elements_[i]);
if (i != first_ranked_.Value() - 1) {
result.append("-");
}
}
result.append("|");
for (int i = first_ranked_.Value(); i <= last_ranked_.Value(); ++i) {
StrAppend(&result, elements_[i]);
absl::StrAppend(&result, elements_[i]);
if (i != last_ranked_.Value()) {
result.append("-");
}
}
result.append("|");
for (int i = last_ranked_.Value() + 1; i < size_; ++i) {
StrAppend(&result, elements_[i]);
absl::StrAppend(&result, elements_[i]);
if (i != size_ - 1) {
result.append("-");
}

View File

@@ -244,14 +244,14 @@ class BronKerboschAlgorithm {
// Creates a human-readable representation of the current state.
std::string DebugString() {
std::string buffer;
StrAppend(&buffer, "pivot = ", pivot,
absl::StrAppend(&buffer, "pivot = ", pivot,
"\nnum_remaining_candidates = ", num_remaining_candidates,
"\ncandidates = [");
for (CandidateIndex i(0); i < candidates.size(); ++i) {
if (i > 0) buffer += ", ";
StrAppend(&buffer, candidates[i]);
absl::StrAppend(&buffer, candidates[i]);
}
StrAppend(
absl::StrAppend(
&buffer, "]\nfirst_candidate_index = ", first_candidate_index.value(),
"\ncandidate_for_recursion = ", candidate_for_recursion.value());
return buffer;
@@ -434,7 +434,7 @@ std::string BronKerboschAlgorithm<NodeIndex>::CliqueDebugString(
const std::vector<NodeIndex>& clique) {
std::string message = "Clique: [ ";
for (const NodeIndex node : clique) {
StrAppend(&message, node, " ");
absl::StrAppend(&message, node, " ");
}
message += "]";
return message;