Skip to content

Commit

Permalink
fix clippy errors in dump_saved_state_depgraph
Browse files Browse the repository at this point in the history
Reviewed By: andrewjkennedy

Differential Revision: D68715181

fbshipit-source-id: ea28b5c884db95fa07f1fb059cb9ab718c694bbb
  • Loading branch information
Catherine Gasnier authored and facebook-github-bot committed Jan 29, 2025
1 parent 6090628 commit d79fa81
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions hphp/hack/src/heap/dump_saved_state_depgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ fn comp_depgraph64(
add_edges(&mut in_r_not_l, dependency, &dependents);
r_dependency_opt = r_dependencies_iter.next();
rproc += 1;
if bar.is_some() && rnum_keys > lnum_keys {
bar.as_ref().unwrap().inc(1); // We advanced `r` and there are more keys in `r` than `l`.
if let Some(bar) = bar.as_ref() {
if rnum_keys > lnum_keys {
bar.inc(1); // We advanced `r` and there are more keys in `r` than `l`.
}
}
}
(Some(l_dependency), None) => {
Expand All @@ -156,8 +158,10 @@ fn comp_depgraph64(
ledge_count += dependents.len();
add_edges(&mut in_l_not_r, dependency, &dependents);
lproc += 1;
if bar.is_some() && lnum_keys > rnum_keys {
bar.as_ref().unwrap().inc(1); // We advanced `l` and there are more keys in `l` than `r`.
if let Some(bar) = bar.as_ref() {
if lnum_keys > rnum_keys {
bar.inc(1); // We advanced `l` and there are more keys in `l` than `r`.
}
}
}
(Some(l_dependency), Some(r_dependency)) => {
Expand All @@ -171,8 +175,10 @@ fn comp_depgraph64(
add_edges(&mut in_l_not_r, l_dependency, &l_dependencies);
l_dependency_opt = l_dependencies_iter.next();
lproc += 1;
if bar.is_some() && lnum_keys >= rnum_keys {
bar.as_ref().unwrap().inc(1); // We advanced `l` and there are more keys in `l` than `r`.
if let Some(bar) = bar.as_ref() {
if lnum_keys >= rnum_keys {
bar.inc(1); // We advanced `l` and there are more keys in `l` than `r`.
}
}
continue;
}
Expand All @@ -182,8 +188,10 @@ fn comp_depgraph64(
add_edges(&mut in_r_not_l, r_dependency, &r_dependencies);
r_dependency_opt = r_dependencies_iter.next();
rproc += 1;
if bar.is_some() && rnum_keys > lnum_keys {
bar.as_ref().unwrap().inc(1); // We advanced `r` and there are more keys in `r` than `l`.
if let Some(bar) = bar.as_ref() {
if rnum_keys > lnum_keys {
bar.inc(1); // We advanced `r` and there are more keys in `r` than `l`.
}
}
continue;
}
Expand All @@ -208,8 +216,8 @@ fn comp_depgraph64(
r_dependency_opt = r_dependencies_iter.next();
lproc += 1;
rproc += 1;
if bar.is_some() {
bar.as_ref().unwrap().inc(1)
if let Some(bar) = bar.as_ref() {
bar.inc(1)
}; // No matter whether `l` or `r` has more keys, progress was made.
}
(None, None) => panic!("The impossible happened!"),
Expand Down Expand Up @@ -278,7 +286,7 @@ Common usage is to provide two file arguments to compare, 'test' and 'control'.
Example invocation:
dump_saved_state_depgraph --bitness 32 \\
dump_saved_state_depgraph \\
--test path/to/test.bin --control path/to/control.bin
Exit code will be 0 if 'test' >= 'control' and 1 if 'test' < 'control'."
Expand Down

0 comments on commit d79fa81

Please sign in to comment.