chore: avoid create an empty array everytime.
This commit is contained in:
parent
bfa37ffcf4
commit
2b916125f0
1 changed files with 10 additions and 3 deletions
|
|
@ -686,6 +686,15 @@ private final case class SavedIslandData(
|
|||
*/
|
||||
@InternalApi private[pekko] object GraphStageTag extends IslandTag
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
@InternalApi
|
||||
private[pekko] object GraphStageIsland {
|
||||
// used as a type hint when creating the array of logics
|
||||
private final val emptyLogicArray = Array.empty[GraphStageLogic]
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
|
|
@ -695,8 +704,6 @@ private final case class SavedIslandData(
|
|||
islandName: String,
|
||||
subflowFuser: OptionVal[GraphInterpreterShell => ActorRef])
|
||||
extends PhaseIsland[GraphStageLogic] {
|
||||
// TODO: remove these
|
||||
private val logicArrayType = Array.empty[GraphStageLogic]
|
||||
private[this] val logics = new util.ArrayList[GraphStageLogic](16)
|
||||
|
||||
private var connections = new Array[Connection](16)
|
||||
|
|
@ -815,7 +822,7 @@ private final case class SavedIslandData(
|
|||
}
|
||||
|
||||
shell.connections = finalConnections
|
||||
shell.logics = logics.toArray(logicArrayType)
|
||||
shell.logics = logics.toArray(GraphStageIsland.emptyLogicArray)
|
||||
|
||||
subflowFuser match {
|
||||
case OptionVal.Some(fuseIntoExistingInterpreter) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue