Class ConstantFolding
java.lang.Object
com.soulfiremc.server.script.ConstantFolding
Constant folding optimization: evaluates subgraphs with all-constant inputs at build time.
Replaces folded nodes with pre-computed constant values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptGraphfold(ScriptGraph graph) Identifies and folds constant subgraphs in the given graph.
-
Method Details
-
fold
Identifies and folds constant subgraphs in the given graph. Returns a new ScriptGraph with constant nodes replacing folded subgraphs, or the original graph if no folding was possible.
-