code optimization
This commit is contained in:
@@ -2,7 +2,6 @@ import { extractTriggersFromPoint } from "./extractTriggersFromPoint";
|
||||
|
||||
export function determineExecutionOrder(products: productsSchema): Action[] {
|
||||
// Create maps for all events and points
|
||||
const eventMap = new Map<string, EventsSchema>();
|
||||
const pointMap = new Map<string, PointsScheme>();
|
||||
const allPoints: PointsScheme[] = [];
|
||||
const spawnActions: Action[] = [];
|
||||
@@ -10,7 +9,6 @@ export function determineExecutionOrder(products: productsSchema): Action[] {
|
||||
// First pass: collect all points and identify spawn actions
|
||||
products.forEach(product => {
|
||||
product.eventDatas.forEach(event => {
|
||||
eventMap.set(event.modelUuid, event);
|
||||
|
||||
if (event.type === 'transfer') {
|
||||
event.points.forEach(point => {
|
||||
@@ -34,7 +32,7 @@ export function determineExecutionOrder(products: productsSchema): Action[] {
|
||||
|
||||
// Check for spawn actions in storage units and other types
|
||||
if (event.type === 'storageUnit') {
|
||||
const storagePoint = event.point as StoragePointSchema;
|
||||
const storagePoint = event.point;
|
||||
storagePoint.actions.forEach(action => {
|
||||
if (action.actionType === 'retrieve') {
|
||||
spawnActions.push(action);
|
||||
|
||||
Reference in New Issue
Block a user