Skip to content

Commit

Permalink
refactor(spgroup#31): extract method removeAll(unit.getDefBoxes(), da…
Browse files Browse the repository at this point in the history
…taFlowAbstraction)
  • Loading branch information
barbosamaatheus committed Dec 22, 2020
1 parent d75103f commit 3a811de
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,18 @@ private void gen(Statement stmt) {

private void kill(Unit unit) {
for (DataFlowAbstraction dataFlowAbstraction : res) {
// TODO extract method res.removeAll (unit.getDefBoxes ())
for (ValueBox valueBox : unit.getDefBoxes()) {
if (isSameVariable(valueBox, dataFlowAbstraction)) {
res.remove(dataFlowAbstraction);
}
}
removeAll(unit.getDefBoxes(), dataFlowAbstraction);
}
}

private void removeAll(List<ValueBox> defBoxes, DataFlowAbstraction dataFlowAbstraction) {
defBoxes.forEach(valueBox -> {
if (isSameVariable(valueBox, dataFlowAbstraction)) {
res.remove(dataFlowAbstraction);
}
});
}

/*
* To detect conflicts res verified if "u" is owned by LEFT or RIGHT
* and we fill res the "potentialConflictingAssignments" list with the changes from the other developer.
Expand Down

0 comments on commit 3a811de

Please sign in to comment.