diff --git a/fixedarray/fixedarray.mbti b/fixedarray/fixedarray.mbti index c57b474d4..bdb390553 100644 --- a/fixedarray/fixedarray.mbti +++ b/fixedarray/fixedarray.mbti @@ -10,7 +10,6 @@ fn new[T](Int, () -> T) -> FixedArray[T] fn new_with_index[T](Int, (Int) -> T) -> FixedArray[T] // Types and methods -type TimSortRun impl FixedArray { all[T](Self[T], (T) -> Bool) -> Bool any[T](Self[T], (T) -> Bool) -> Bool diff --git a/fixedarray/sort.mbt b/fixedarray/sort.mbt index 337935bad..6e7b5de2c 100644 --- a/fixedarray/sort.mbt +++ b/fixedarray/sort.mbt @@ -27,7 +27,7 @@ pub fn stable_sort[T : Compare](self : FixedArray[T]) -> Unit { timsort({ array: self, start: 0, end: self.length() }) } -struct TimSortRun { +priv struct TimSortRun { len : Int start : Int } diff --git a/hashmap/hashmap_test.mbt b/hashmap/hashmap_test.mbt index 736c90f7f..7e7adec0e 100644 --- a/hashmap/hashmap_test.mbt +++ b/hashmap/hashmap_test.mbt @@ -26,17 +26,13 @@ impl Show for MyString with to_string(self) { self.0 } test "set" { let m : HashMap[MyString, Int] = HashMap::new() - fn i(s) { - MyString::MyString(s) - } - - m.set("a" |> i, 1) - m.set("b" |> i, 1) - m.set("bc" |> i, 2) - m.set("abc" |> i, 3) - m.set("cd" |> i, 2) - m.set("c" |> i, 1) - m.set("d" |> i, 1) + m.set("a", 1) + m.set("b", 1) + m.set("bc", 2) + m.set("abc", 3) + m.set("cd", 2) + m.set("c", 1) + m.set("d", 1) @assertion.assert_eq(m.size, 7)? inspect( m.debug_entries(), @@ -108,17 +104,13 @@ test "from_array" { test "remove" { let m : HashMap[MyString, Int] = HashMap::new() - fn i(s) { - MyString::MyString(s) - } - - m.set("a" |> i, 1) - m.set("ab" |> i, 2) - m.set("bc" |> i, 2) - m.set("cd" |> i, 2) - m.set("abc" |> i, 3) - m.set("abcdef" |> i, 6) - m.remove("ab" |> i) + m.set("a", 1) + m.set("ab", 2) + m.set("bc", 2) + m.set("cd", 2) + m.set("abc", 3) + m.set("abcdef", 6) + m.remove("ab") @assertion.assert_eq(m.size(), 5)? inspect( m.debug_entries(), @@ -128,14 +120,10 @@ test "remove" { test "remove_unexist_key" { let m : HashMap[MyString, Int] = HashMap::new() - fn i(s) { - MyString::MyString(s) - } - - m.set("a" |> i, 1) - m.set("ab" |> i, 2) - m.set("abc" |> i, 3) - m.remove("d" |> i) + m.set("a", 1) + m.set("ab", 2) + m.set("abc", 3) + m.remove("d") @assertion.assert_eq(m.size(), 3)? inspect(m.debug_entries(), content="_,(0,a,1),(0,ab,2),(0,abc,3),_,_,_,_")? } @@ -193,20 +181,20 @@ test "grow" { MyString::MyString(s) } - m.set("C" |> i, 1) - m.set("Go" |> i, 2) - m.set("C++" |> i, 3) - m.set("Java" |> i, 4) - m.set("Scala" |> i, 5) - m.set("Julia" |> i, 5) + m.set("C", 1) + m.set("Go", 2) + m.set("C++", 3) + m.set("Java", 4) + m.set("Scala", 5) + m.set("Julia", 5) @assertion.assert_eq(m.size, 6)? @assertion.assert_eq(m.capacity, 8)? - m.set("Cobol" |> i, 5) + m.set("Cobol", 5) @assertion.assert_eq(m.size, 7)? @assertion.assert_eq(m.capacity, 16)? - m.set("Python" |> i, 6) - m.set("Haskell" |> i, 7) - m.set("Rescript" |> i, 8) + m.set("Python", 6) + m.set("Haskell", 7) + m.set("Rescript", 8) @assertion.assert_eq(m.size, 10)? @assertion.assert_eq(m.capacity, 16)? inspect(