Skip to content

Commit

Permalink
args drop returns scala iterator, no need to cast again, toArray will…
Browse files Browse the repository at this point in the history
… work

closes MightyPirates#3159
  • Loading branch information
payonel committed May 11, 2021
1 parent a1d1834 commit 90be018
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/li/cil/oc/server/component/DebugCard.scala
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ class DebugCard(host: EnvironmentHost) extends prefab.ManagedEnvironment with De
checkAccess()
val destination = args.checkString(0)
DebugNetwork.getEndpoint(destination).filter(_ != this).foreach{endpoint =>
// Cast to iterable to use Scala's toArray instead of the Arguments' one (which converts byte arrays to Strings).
val packet = Network.newPacket(node.address, destination, 0, args.drop(1).asInstanceOf[java.lang.Iterable[AnyRef]].toArray)
val packet = Network.newPacket(node.address, destination, 0, args.drop(1).toArray)
endpoint.receivePacket(packet)
}
result()
Expand Down

0 comments on commit 90be018

Please sign in to comment.