Skip to content

Commit

Permalink
fix(GraphOptimizer): references gathered before optim were empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bearmit committed Aug 11, 2023
1 parent f90bf0f commit ad00d30
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/typescript/src/utilities/cript-graph-optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down

0 comments on commit ad00d30

Please sign in to comment.