File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -913,13 +913,13 @@ export default {
913
913
914
914
getGraphEdges () {
915
915
// map graph edges from the store (non reactive)
916
- const ret = []
916
+ const ret = new Map ()
917
917
for (const { $edges } of this .workflows ) {
918
918
for (const { tokens } of $edges || []) {
919
- ret .push ([ tokens .id , new Edge (tokens)] )
919
+ ret .set ( tokens .id , new Edge (tokens))
920
920
}
921
921
}
922
- return new Map ( ret)
922
+ return ret
923
923
},
924
924
925
925
/**
@@ -1172,11 +1172,15 @@ export default {
1172
1172
return ret .join (' \n ' )
1173
1173
},
1174
1174
1175
+ /**
1176
+ * Generate a hash for this list of nodes and edges.
1177
+ * @param {Node[]} nodes
1178
+ * @param {Map<string, Edge>} edges
1179
+ */
1175
1180
hashGraph (nodes , edges ) {
1176
- // generate a hash for this list of nodes and edges
1177
1181
return nonCryptoHash (
1178
- nodes .map ( n => n . id ). reduce ((x , y ) => x + y ) +
1179
- Array .from (edges .keys ()).reduce ((x , y ) => x + y, 1 )
1182
+ nodes .reduce ((acc , n ) => acc + n . id , ' ' ) +
1183
+ Array .from (edges .keys ()).reduce ((acc , id ) => acc + id, ' ' )
1180
1184
)
1181
1185
},
1182
1186
You can’t perform that action at this time.
0 commit comments