remove redundant hashset conversion

Summary:
Since the find_commits_to_send method was added, common is already a
hashset not a vector, so it doesn't needed to be converted to a hashset.

Reviewed By: quark-zju

Differential Revision: D30622028

fbshipit-source-id: e5d1b6c60115d13c906b25142043652ba9e89d70
This commit is contained in:
Carolyn Busch 2021-09-07 19:47:38 -07:00 committed by Facebook GitHub Bot
parent 0ffe94b9f0
commit 0b2f5849cb

View File

@ -58,7 +58,6 @@ use stats::prelude::*;
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
convert::TryInto, convert::TryInto,
iter::FromIterator,
sync::Arc, sync::Arc,
}; };
use tunables::tunables; use tunables::tunables;
@ -261,7 +260,6 @@ async fn find_commits_to_send(
heads: &[HgChangesetId], heads: &[HgChangesetId],
lca_hint: &Arc<dyn LeastCommonAncestorsHint>, lca_hint: &Arc<dyn LeastCommonAncestorsHint>,
) -> Result<Vec<ChangesetId>, Error> { ) -> Result<Vec<ChangesetId>, Error> {
let common_heads: HashSet<_> = HashSet::from_iter(common.iter());
let changeset_fetcher = blobrepo.get_changeset_fetcher(); let changeset_fetcher = blobrepo.get_changeset_fetcher();
let heads = hg_to_bonsai_stream( let heads = hg_to_bonsai_stream(
@ -269,7 +267,7 @@ async fn find_commits_to_send(
&blobrepo, &blobrepo,
heads heads
.iter() .iter()
.filter(|head| !common_heads.contains(head)) .filter(|head| !common.contains(head))
.cloned() .cloned()
.collect(), .collect(),
); );