Skip to content

Commit 4b658b4

Browse files
committed
Make Int.until/to and InclusiveRange.new inline
These methods are so trivial there's no reason to _not_ inline them whenever called. Changelog: performance
1 parent 103e6db commit 4b658b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

std/src/std/int.inko

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ type builtin Int {
319319
}
320320

321321
# Returns a `Range` from `self` up to but excluding `other`.
322-
fn pub until(other: Int) -> ExclusiveRange {
322+
fn pub inline until(other: Int) -> ExclusiveRange {
323323
ExclusiveRange.new(clone, other)
324324
}
325325

326326
# Returns a `Range` from `self` up to and including `other`.
327-
fn pub to(other: Int) -> InclusiveRange {
327+
fn pub inline to(other: Int) -> InclusiveRange {
328328
InclusiveRange.new(clone, other)
329329
}
330330

std/src/std/range.inko

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type pub copy InclusiveRange {
5050
let @end: Int
5151

5252
# Returns a new `InclusiveRange` over the given values.
53-
fn pub static new(start: Int, end: Int) -> InclusiveRange {
53+
fn pub inline static new(start: Int, end: Int) -> InclusiveRange {
5454
InclusiveRange(start: start, end: end)
5555
}
5656
}

0 commit comments

Comments
 (0)