Skip to content

Commit dd7b212

Browse files
committed
Eliminate more warnings
1 parent d90caa2 commit dd7b212

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/core/rudiments-core.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ extension [ValueType](iterable: Iterable[ValueType])
217217

218218
extension [ElemType](value: IArray[ElemType])
219219
inline def mutable(using Unsafe): Array[ElemType] = value.asMatchable.runtimeChecked match
220-
case array: Array[ElemType] => array
220+
case array: (Array[ElemType] @unchecked) => array
221221

222222
extension [ElemType](array: Array[ElemType])
223223
def immutable(using Unsafe): IArray[ElemType] = array.runtimeChecked match
224-
case array: IArray[ElemType] => array
224+
case array: (IArray[ElemType] @unchecked) => array
225225

226226
def snapshot(using ClassTag[ElemType]): IArray[ElemType] =
227227
val newArray = new Array[ElemType](array.length)

src/core/rudiments.Indexable.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Indexable:
3232
type Result = ElementType
3333

3434
def contains(array: IArray[ElementType], index: Ordinal): Boolean =
35-
index.n0 >= 0 && index.n0 <= Ult.of(array.length).n0
35+
index.n0 >= 0 && index.n0 <= Ult.of(array).n0
3636

3737
def access(array: IArray[ElementType], index: Ordinal): Result = array(index.n0)
3838

@@ -43,7 +43,7 @@ object Indexable:
4343
type Result = ElementType
4444

4545
def contains(seq: IndexedSeq[ElementType], index: Ordinal): Boolean =
46-
index.n0 >= 0 && index.n0 <= Ult.of(seq.length).n0
46+
index.n0 >= 0 && index.n0 <= Ult.of(seq).n0
4747

4848
def access(seq: IndexedSeq[ElementType], index: Ordinal): Result = seq(index.n0)
4949

@@ -53,7 +53,7 @@ object Indexable:
5353
type Result = Char
5454

5555
def contains(text: Text, index: Ordinal): Boolean =
56-
index.n0 >= 0 && index.n0 <= Ult.of(text).n0
56+
index.n0 >= 0 && index.n0 < text.s.length
5757

5858
def access(text: Text, index: Ordinal): Result = text.s.charAt(index.n0)
5959

0 commit comments

Comments
 (0)