mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
use VecSet in IntroducedVariables
This commit is contained in:
parent
a1a7feca45
commit
2c0b29efd1
2 changed files with 6 additions and 6 deletions
|
@ -285,19 +285,19 @@ impl<T: PartialEq> VecSet<T> {
|
||||||
|
|
||||||
impl<A: Ord> Extend<A> for VecSet<A> {
|
impl<A: Ord> Extend<A> for VecSet<A> {
|
||||||
fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T) {
|
fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T) {
|
||||||
let mut it = iter.into_iter();
|
let it = iter.into_iter();
|
||||||
let hint = it.size_hint();
|
let hint = it.size_hint();
|
||||||
|
|
||||||
match hint {
|
match hint {
|
||||||
(0, Some(0)) => {
|
(0, Some(0)) => {
|
||||||
// done, do nothing
|
// done, do nothing
|
||||||
}
|
}
|
||||||
(1, Some(1)) => {
|
(1, Some(1)) | (2, Some(2)) => {
|
||||||
let value = it.next().unwrap();
|
for value in it {
|
||||||
self.insert(value);
|
self.insert(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
println!("extend {:?}", hint);
|
|
||||||
self.elements.extend(it);
|
self.elements.extend(it);
|
||||||
|
|
||||||
self.elements.sort();
|
self.elements.sort();
|
||||||
|
|
|
@ -41,7 +41,7 @@ use roc_types::solved_types::Solved;
|
||||||
use roc_types::subs::{Subs, VarStore, Variable};
|
use roc_types::subs::{Subs, VarStore, Variable};
|
||||||
use roc_types::types::{Alias, AliasCommon, TypeExtension};
|
use roc_types::types::{Alias, AliasCommon, TypeExtension};
|
||||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||||
use std::collections::{HashMap, };
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue