Skip to content

Commit 70c5e3c

Browse files
authored
Fix bug in StrAppendList for BasicBlockGraphBuilder::DebugString. (#362)
* Fixes a bug in `StrAppendList` which caused item separator commas intended to be in the returned list string representation to be missing.
1 parent efe423f commit 70c5e3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gematria/granite/graph_builder.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ void StrAppendList(std::stringstream& buffer, std::string_view list_name,
485485
buffer << list_name << " = [";
486486
bool first = true;
487487
for (const auto& item : items) {
488-
if (!first) {
489-
buffer << ",";
488+
if (first) {
490489
first = false;
490+
} else {
491+
buffer << ", ";
491492
}
492493
buffer << item;
493494
}

0 commit comments

Comments
 (0)