void (@NotNull SwitchStatement switchStatement, @NotNull List<TempVarAssignmentItem> tempVarAssignments) { Set<StatEdge> labelsToDelete = new HashSet<>(); Set<VarExprent> tempVars = tempVarAssignments.stream().map(t -> t.varExprent()).collect(Collectors.toSet()); for (StatEdge label : switchStatement.getLabelEdges()) { if (!label.explicit || !label.labeled) { continue; } Statement source = label.getSource(); if (!(source instanceof BasicBlockStatement basicBlockStatement)) { continue; } boolean toDelete = true; if (basicBlockStatement.getExprents() == null) { continue; } for (Exprent exprent : basicBlockStatement.getExprents()) { if (!(exprent instanceof AssignmentExprent assignmentExprent)) { toDelete = false; break; } if (!tempVars.contains(assignmentExprent.getLeft())) { toDelete = false; break; } } if (toDelete) { labelsToDelete.add(label); } } switchStatement.getLabelEdges().removeAll(labelsToDelete); }