Skip to content

Commit

Permalink
Avoid sort nodes in place
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Aug 16, 2024
1 parent f913d66 commit 832dbaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/litegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ const globalExport = {};
*/
serialize() {
var nodes_info = [];
nodes_info = this._nodes.sort((a, b) => a.id - b.id).map(node => node.serialize());
nodes_info = [...this._nodes].sort((a, b) => a.id - b.id).map(node => node.serialize());

//pack link info into a non-verbose format
var links = [];
Expand Down

0 comments on commit 832dbaa

Please sign in to comment.