Skip to content

Commit

Permalink
fix: doc error
Browse files Browse the repository at this point in the history
style: update conditions
  • Loading branch information
CAIMEOX committed Mar 21, 2024
1 parent 1f02a06 commit af2ff80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions array/array.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ test "fold_rev" {
/// # Example
/// ```
/// let arr = [1, 2, 3, 4, 5]
/// arr // [5, 4, 3, 2, 1]
/// reverse(arr) // [5, 4, 3, 2, 1]
/// ```
pub fn reverse[T](self : Array[T]) -> Unit {
let mid_len = self.length() / 2
Expand Down Expand Up @@ -360,7 +360,7 @@ test "swap" {
/// ```
pub fn all[T](self : Array[T], f : (T) -> Bool) -> Bool {
for i = 0; i < self.length(); i = i + 1 {
if f(self[i]) == false {
if f(self[i]).not() {
return false
}
}
Expand All @@ -384,7 +384,7 @@ test "all" {
/// ```
pub fn any[T](self : Array[T], f : (T) -> Bool) -> Bool {
for i = 0; i < self.length(); i = i + 1 {
if f(self[i]) == true {
if f(self[i]) {
return true
}
}
Expand Down

0 comments on commit af2ff80

Please sign in to comment.