mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-09 05:28:22 +01:00
fix: Use a checked cast by reifying the generic type parameter
This commit is contained in:
parent
a627510edf
commit
f7a296e1f1
@ -115,7 +115,7 @@ fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback:
|
||||
* if the [Instruction] is not a [ReferenceInstruction] or the [Reference] is not of type [T].
|
||||
* @see ReferenceInstruction
|
||||
*/
|
||||
fun <T : Reference> Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T
|
||||
inline fun <reified T : Reference> Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T
|
||||
|
||||
/**
|
||||
* Get the index of the first [Instruction] that matches the predicate.
|
||||
|
Loading…
Reference in New Issue
Block a user