-
-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reserve Vector elements instead of resizing
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ogham
Owner
|
||
|
||
for i in 1 .. row.depth + 1 { | ||
|
I’d like to think that it only grows the buffer, not shrinking it—I’ll test this before I merge