提交 7a97b7d4 编写于 作者: F Florian Gilcher

Reserve Vector elements instead of resizing

上级 7f53da73
......@@ -683,7 +683,7 @@ impl<U> Table<U> where U: Users {
// necessary to maintain information about the previously-printed
// lines, as the output will change based on whether the
// *previous* entry was the last in its directory.
stack.resize(row.depth + 1, TreePart::Edge);
stack.reserve(row.depth + 1);
stack[row.depth] = if row.last { TreePart::Corner } else { TreePart::Edge };
for i in 1 .. row.depth + 1 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册