From ad00d3040a13b69c66ae815bf4b19198e855cfbe Mon Sep 17 00:00:00 2001 From: bearmit Date: Fri, 11 Aug 2023 12:05:15 -0400 Subject: [PATCH] fix(GraphOptimizer): references gathered before optim were empty --- .../typescript/src/utilities/cript-graph-optimizer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/typescript/src/utilities/cript-graph-optimizer.ts b/scripts/typescript/src/utilities/cript-graph-optimizer.ts index 3237f41..350e4eb 100644 --- a/scripts/typescript/src/utilities/cript-graph-optimizer.ts +++ b/scripts/typescript/src/utilities/cript-graph-optimizer.ts @@ -234,18 +234,18 @@ export class CriptGraphOptimizer { * - uses Edge or EdgeUUID when possible * - criptObject not changed (a deep copy is made) */ - get_optimized(criptObject: IProject): OptimizedProject { + get_optimized(project: IProject): OptimizedProject { this.reset_state(); // Generate an optimized structure - const criptObjectCopy = structuredClone(criptObject); + const _project = this.optimize_recursively('', structuredClone(project)); + const result: OptimizedProject = { shared: { - reference: [...this.shared_references.values()], + reference: [...this.shared_references.values()] }, - project: this.optimize_recursively('', criptObjectCopy) + project: _project } - // Warn user in case no references are present if( result.shared.reference.length === 0 ) { this.debug(`No shared references found`);