mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
drop into_iter in some places
This commit is contained in:
parent
e6a154765c
commit
6ab54c02e2
@ -205,7 +205,7 @@ impl<T> ArenaPool<T> {
|
|||||||
// Add the arena's extra chunks to our own, so their memory remains live
|
// Add the arena's extra chunks to our own, so their memory remains live
|
||||||
// after the arena gets dropped. This is important, because at this
|
// after the arena gets dropped. This is important, because at this
|
||||||
// point their pointers can still potentially be dereferenced!
|
// point their pointers can still potentially be dereferenced!
|
||||||
self.extra_chunks.extend(arena.extra_chunks.into_iter());
|
self.extra_chunks.extend(arena.extra_chunks);
|
||||||
|
|
||||||
self.num_leased -= 1;
|
self.num_leased -= 1;
|
||||||
}
|
}
|
||||||
|
@ -701,7 +701,7 @@ fn convert_tag(subs: &Subs, whole_var: Variable, this_tag: &TagName) -> (Union,
|
|||||||
let mut my_tag_id = TagId(num_tags as TagIdIntType);
|
let mut my_tag_id = TagId(num_tags as TagIdIntType);
|
||||||
|
|
||||||
let mut alternatives = Vec::with_capacity(num_tags);
|
let mut alternatives = Vec::with_capacity(num_tags);
|
||||||
let alternatives_iter = sorted_tags.into_iter().chain(opt_openness_tag.into_iter());
|
let alternatives_iter = sorted_tags.into_iter().chain(opt_openness_tag);
|
||||||
|
|
||||||
let mut index = 0;
|
let mut index = 0;
|
||||||
for (tag, args) in alternatives_iter {
|
for (tag, args) in alternatives_iter {
|
||||||
|
@ -1887,7 +1887,7 @@ fn build_tag<'a, 'ctx>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
let struct_type = env.context.struct_type(
|
let struct_type = env.context.struct_type(
|
||||||
env.arena.alloc_slice_fill_iter(field_types.into_iter()),
|
env.arena.alloc_slice_fill_iter(field_types),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2237,7 +2237,7 @@ fn update<'a>(
|
|||||||
// If we're building an app module, and this was the platform
|
// If we're building an app module, and this was the platform
|
||||||
// specified in its header's `to` field, record it as our platform.
|
// specified in its header's `to` field, record it as our platform.
|
||||||
if state.opt_platform_shorthand == Some(config_shorthand) {
|
if state.opt_platform_shorthand == Some(config_shorthand) {
|
||||||
debug_assert!(matches!(state.platform_data, None));
|
debug_assert!(state.platform_data.is_none());
|
||||||
|
|
||||||
state.platform_data = Some(PlatformData {
|
state.platform_data = Some(PlatformData {
|
||||||
module_id: header.module_id,
|
module_id: header.module_id,
|
||||||
|
@ -70,7 +70,7 @@ impl MakeSpecializationsDependents {
|
|||||||
"already added successors for module '{module_id:?}'"
|
"already added successors for module '{module_id:?}'"
|
||||||
);
|
);
|
||||||
|
|
||||||
entry.succ.extend(succ.into_iter());
|
entry.succ.extend(succ);
|
||||||
|
|
||||||
// The module for derives implicitly depends on every other module
|
// The module for derives implicitly depends on every other module
|
||||||
entry.succ.insert(ModuleId::DERIVED_GEN);
|
entry.succ.insert(ModuleId::DERIVED_GEN);
|
||||||
@ -334,13 +334,13 @@ impl<'a> Dependencies<'a> {
|
|||||||
let entry = self
|
let entry = self
|
||||||
.waiting_for
|
.waiting_for
|
||||||
.entry(next_step.clone())
|
.entry(next_step.clone())
|
||||||
.or_insert_with(Default::default);
|
.or_default();
|
||||||
|
|
||||||
entry.insert(job.clone());
|
entry.insert(job.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let entry = self.notifies.entry(job).or_insert_with(Default::default);
|
let entry = self.notifies.entry(job).or_default();
|
||||||
|
|
||||||
entry.insert(next_step);
|
entry.insert(next_step);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ impl<'a> PartialProcs<'a> {
|
|||||||
pub fn drain(self) -> impl Iterator<Item = (Symbol, PartialProc<'a>)> {
|
pub fn drain(self) -> impl Iterator<Item = (Symbol, PartialProc<'a>)> {
|
||||||
debug_assert_eq!(self.symbols.len(), self.partial_procs.len());
|
debug_assert_eq!(self.symbols.len(), self.partial_procs.len());
|
||||||
|
|
||||||
self.symbols.into_iter().zip(self.partial_procs.into_iter())
|
self.symbols.into_iter().zip(self.partial_procs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ impl<'a> ExternalSpecializations<'a> {
|
|||||||
self.storage.into_storage_subs(),
|
self.storage.into_storage_subs(),
|
||||||
self.symbol_or_lambda
|
self.symbol_or_lambda
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(self.types_to_specialize.into_iter()),
|
.zip(self.types_to_specialize),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,8 +656,8 @@ impl<'a> Specialized<'a> {
|
|||||||
fn into_iter_assert_done(self) -> impl Iterator<Item = (Symbol, ProcLayout<'a>, Proc<'a>)> {
|
fn into_iter_assert_done(self) -> impl Iterator<Item = (Symbol, ProcLayout<'a>, Proc<'a>)> {
|
||||||
self.symbols
|
self.symbols
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(self.proc_layouts.into_iter())
|
.zip(self.proc_layouts)
|
||||||
.zip(self.procedures.into_iter())
|
.zip(self.procedures)
|
||||||
.filter_map(|((s, l), in_progress)| {
|
.filter_map(|((s, l), in_progress)| {
|
||||||
if let Symbol::REMOVED_SPECIALIZATION = s {
|
if let Symbol::REMOVED_SPECIALIZATION = s {
|
||||||
None
|
None
|
||||||
|
@ -1937,7 +1937,7 @@ impl<'a> LambdaSet<'a> {
|
|||||||
// it to both vectors.
|
// it to both vectors.
|
||||||
let mut joined = set
|
let mut joined = set
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(set_with_variables.into_iter())
|
.zip(set_with_variables)
|
||||||
.collect::<std::vec::Vec<_>>();
|
.collect::<std::vec::Vec<_>>();
|
||||||
joined.sort_by(|(lam_and_captures1, _), (lam_and_captures2, _)| {
|
joined.sort_by(|(lam_and_captures1, _), (lam_and_captures2, _)| {
|
||||||
lam_and_captures1.cmp(lam_and_captures2)
|
lam_and_captures1.cmp(lam_and_captures2)
|
||||||
|
@ -2715,7 +2715,7 @@ impl VariableSubsSlice {
|
|||||||
{
|
{
|
||||||
let start = subs.variables.len() as u32;
|
let start = subs.variables.len() as u32;
|
||||||
|
|
||||||
subs.variables.extend(input.into_iter());
|
subs.variables.extend(input);
|
||||||
|
|
||||||
let length = (subs.variables.len() as u32 - start) as u16;
|
let length = (subs.variables.len() as u32 - start) as u16;
|
||||||
|
|
||||||
@ -2939,7 +2939,7 @@ where
|
|||||||
&self,
|
&self,
|
||||||
) -> impl Iterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
|
) -> impl Iterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
|
||||||
{
|
{
|
||||||
self.labels().into_iter().zip(self.variables().into_iter())
|
self.labels().into_iter().zip(self.variables())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterator over (Tag, &[Variable]) pairs obtained by
|
/// Iterator over (Tag, &[Variable]) pairs obtained by
|
||||||
@ -3325,8 +3325,8 @@ impl RecordFields {
|
|||||||
|
|
||||||
let it = range1
|
let it = range1
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(range2.into_iter())
|
.zip(range2)
|
||||||
.zip(range3.into_iter());
|
.zip(range3);
|
||||||
|
|
||||||
it.map(|((i1, i2), i3)| (SubsIndex::new(i1), SubsIndex::new(i2), SubsIndex::new(i3)))
|
it.map(|((i1, i2), i3)| (SubsIndex::new(i1), SubsIndex::new(i2), SubsIndex::new(i3)))
|
||||||
}
|
}
|
||||||
@ -3407,7 +3407,7 @@ impl TupleElems {
|
|||||||
let range1 = helper(self.elem_index_start);
|
let range1 = helper(self.elem_index_start);
|
||||||
let range2 = helper(self.variables_start);
|
let range2 = helper(self.variables_start);
|
||||||
|
|
||||||
let it = range1.into_iter().zip(range2.into_iter());
|
let it = range1.into_iter().zip(range2);
|
||||||
|
|
||||||
it.map(|(i1, i2)| (SubsIndex::new(i1), SubsIndex::new(i2)))
|
it.map(|(i1, i2)| (SubsIndex::new(i1), SubsIndex::new(i2)))
|
||||||
}
|
}
|
||||||
|
@ -731,15 +731,15 @@ fn unify_two_aliases<M: MetaCollector>(
|
|||||||
let args_it = args
|
let args_it = args
|
||||||
.type_variables()
|
.type_variables()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(other_args.type_variables().into_iter());
|
.zip(other_args.type_variables());
|
||||||
|
|
||||||
let lambda_set_it = args
|
let lambda_set_it = args
|
||||||
.lambda_set_variables()
|
.lambda_set_variables()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(other_args.lambda_set_variables().into_iter());
|
.zip(other_args.lambda_set_variables());
|
||||||
|
|
||||||
let infer_ext_in_output_vars_it = (args.infer_ext_in_output_variables().into_iter())
|
let infer_ext_in_output_vars_it = (args.infer_ext_in_output_variables().into_iter())
|
||||||
.zip(other_args.infer_ext_in_output_variables().into_iter());
|
.zip(other_args.infer_ext_in_output_variables());
|
||||||
|
|
||||||
let mut merged_args = Vec::with_capacity(args.type_variables().len());
|
let mut merged_args = Vec::with_capacity(args.type_variables().len());
|
||||||
let mut merged_lambda_set_args = Vec::with_capacity(args.lambda_set_variables().len());
|
let mut merged_lambda_set_args = Vec::with_capacity(args.lambda_set_variables().len());
|
||||||
@ -3391,7 +3391,7 @@ fn unify_zip_slices<M: MetaCollector>(
|
|||||||
) -> Outcome<M> {
|
) -> Outcome<M> {
|
||||||
let mut outcome = Outcome::default();
|
let mut outcome = Outcome::default();
|
||||||
|
|
||||||
let it = left.into_iter().zip(right.into_iter());
|
let it = left.into_iter().zip(right);
|
||||||
|
|
||||||
for (l_index, r_index) in it {
|
for (l_index, r_index) in it {
|
||||||
let l_var = env[l_index];
|
let l_var = env[l_index];
|
||||||
|
Loading…
Reference in New Issue
Block a user