Skip to content

Commit

Permalink
Suggestions from github ai
Browse files Browse the repository at this point in the history
  • Loading branch information
james-strauss-uwa committed May 23, 2024
1 parent db31d40 commit d83685f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/Edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,10 @@ export class Edge {

// check if the edge already exists in the graph, there is no point in a duplicate
for (const edge of eagle.logicalGraph().getEdges()){
if (edge.getSrcNodeKey() === sourceNodeKey &&
edge.getSrcPortId() === sourcePortId &&
edge.getDestNodeKey() === destinationNodeKey &&
edge.getDestPortId() === destinationPortId &&
edge.getId() !== edgeId){
const isSrcMatch = edge.getSrcNodeKey() === sourceNodeKey && edge.getSrcPortId() === sourcePortId;
const isDestMatch = edge.getDestNodeKey() === destinationNodeKey && edge.getDestPortId() === destinationPortId;

if ( isSrcMatch && isDestMatch && edge.getId() !== edgeId){
const x = Errors.ShowFix("Edge is a duplicate. Another edge with the same source port and destination port already exists", function(){Utils.showEdge(eagle, edgeId);}, function(){Utils.fixDeleteEdge(eagle, edgeId);}, "Delete edge");
Edge.isValidLog(edgeId, Eagle.LinkValid.Invalid, x, showNotification, showConsole, errorsWarnings);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ export class Utils {
object.setId(Utils.uuidv4());
}

static newFieldId(eagle: Eagle, node: Node, field: Field){
static newFieldId(eagle: Eagle, node: Node, field: Field): void {
const oldId = field.getId();
const newId: string = Utils.uuidv4();

Expand Down

0 comments on commit d83685f

Please sign in to comment.