mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 21:10:29 +00:00
Simplify the API and implementation of Stack (#667)
This commit is contained in:
1 parent
8fccecadeb
commit
08a2d44570
6 files changed
+43
-100
No files matched your search
@@ -84,12 +84,13 @@ void Action::Print(llvm::raw_ostream& out) const {
|
||||
}
|
||||
}
|
||||
|
||||
void Action::PrintList(Stack<Action*> ls, llvm::raw_ostream& out) {
|
||||
if (!ls.IsEmpty()) {
|
||||
out << *ls.Pop();
|
||||
if (!ls.IsEmpty()) {
|
||||
void Action::PrintList(const Stack<Action*>& ls, llvm::raw_ostream& out) {
|
||||
auto it = ls.begin();
|
||||
while (it != ls.end()) {
|
||||
out << **it;
|
||||
++it;
|
||||
if (it != ls.end()) {
|
||||
out << " :: ";
|
||||
PrintList(ls, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user