Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SwiftJavaJNICore/BridgedValues/JavaValue+Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension Array: JavaValue where Element: JavaValue {
}
initializedCount = count
}
self = result as! Self
self = unsafeBitCast(result, to: Self.self)
} else if Element.self == Int8.self {
let result = [Int8](unsafeUninitializedCapacity: Int(jniCount)) { buffer, initializedCount in
Int8.jniGetArrayRegion(in: environment)(
Expand All @@ -57,7 +57,7 @@ extension Array: JavaValue where Element: JavaValue {
)
initializedCount = count
}
self = result as! Self
self = unsafeBitCast(result, to: Self.self)
} else {
// Slow path for other types: create intermediate array and map
let jniArray = [Element.JNIType](unsafeUninitializedCapacity: count) { buffer, initializedCount in
Expand Down
Loading