Skip to content

Commit

Permalink
Merge pull request #495 from savi-lang/remove/until-methods
Browse files Browse the repository at this point in the history
Remove `*_until`-style iteration methods.
  • Loading branch information
jemc committed Sep 7, 2024
2 parents d59b999 + a549617 commit 32e8caa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
24 changes: 0 additions & 24 deletions core/Indexable.savi
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,6 @@
yield value
)

:: DEPRECATED: Use `break` to exit early from `each` if needed.
:fun each_until(
from USize = 0
to = USize.max_value
stride USize = 1
)
:yields for Bool // TODO: this type hint shouldn't be needed
@each(from, to, stride) -> (value |
return True if (yield value)
)
False

:: DEPRECATED: Use `break` to exit early from `each_with_index` if needed.
:fun each_with_index_until(
from USize = 0
to = USize.max_value
stride USize = 1
)
:yields for Bool // TODO: this type hint shouldn't be needed
@each_with_index(from, to, stride) -> (value, index |
return True if (yield (value, index))
)
False

:fun has_any(
from USize = 0
to = USize.max_value
Expand Down
8 changes: 0 additions & 8 deletions core/String.savi
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,6 @@
yield value
)

:: DEPRECATED: Use `break` to exit early from `each_byte` if needed.
:fun each_byte_until(from USize = 0, to = USize.max_value, stride USize = 1)
:yields for Bool
@each_byte(from, to, stride) -> (byte |
return True if (yield byte)
)
False

// TODO: Move to be on a new `Indexable.Bytes` trait?
:fun each_byte_with_index(from USize = 0, to = USize.max_value, stride USize = 1)
index = from
Expand Down

0 comments on commit 32e8caa

Please sign in to comment.