#22429 Use Arrays.copy instead of scala builder
This commit is contained in:
parent
4bb283b458
commit
9550e34394
1 changed files with 3 additions and 3 deletions
|
|
@ -579,8 +579,8 @@ final class GraphStageIsland(
|
||||||
subflowFuser: OptionVal[GraphInterpreterShell ⇒ ActorRef]) extends PhaseIsland[GraphStageLogic] {
|
subflowFuser: OptionVal[GraphInterpreterShell ⇒ ActorRef]) extends PhaseIsland[GraphStageLogic] {
|
||||||
// TODO: remove these
|
// TODO: remove these
|
||||||
private val logicArrayType = Array.empty[GraphStageLogic]
|
private val logicArrayType = Array.empty[GraphStageLogic]
|
||||||
private[this] val logics = new ArrayList[GraphStageLogic](64)
|
private[this] val logics = new ArrayList[GraphStageLogic](16)
|
||||||
// TODO: Resize
|
|
||||||
private var connections = new Array[Connection](16)
|
private var connections = new Array[Connection](16)
|
||||||
private var maxConnections = 0
|
private var maxConnections = 0
|
||||||
private var outConnections: List[Connection] = Nil
|
private var outConnections: List[Connection] = Nil
|
||||||
|
|
@ -614,7 +614,7 @@ final class GraphStageIsland(
|
||||||
def conn(slot: Int): Connection = {
|
def conn(slot: Int): Connection = {
|
||||||
maxConnections = math.max(slot, maxConnections)
|
maxConnections = math.max(slot, maxConnections)
|
||||||
if (maxConnections >= connections.length) {
|
if (maxConnections >= connections.length) {
|
||||||
connections = connections.padTo(connections.length * 2, null)
|
connections = java.util.Arrays.copyOf(connections, connections.length * 2)
|
||||||
}
|
}
|
||||||
val c = connections(slot)
|
val c = connections(slot)
|
||||||
if (c ne null) c
|
if (c ne null) c
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue