Skip to content

Commit e35431a

Browse files
committed
Remove extra lookups and memory allocations from tsort graph construction
1 parent f70e3d4 commit e35431a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/uu/tsort/src/tsort.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ enum TsortError {
4242

4343
impl UError for TsortError {}
4444

45-
46-
4745
#[uucore::main]
4846
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
4947
let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
@@ -65,9 +63,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
6563

6664
// Create the directed graph from pairs of tokens in the input data.
6765
let mut g = Graph::new(input.to_string_lossy().to_string());
68-
66+
6967
let mut edgetokens = data.split_whitespace();
70-
68+
7169
loop {
7270
let Some(a) = edgetokens.next() else {
7371
break;

0 commit comments

Comments
 (0)