Skip to content

Commit 4f0a944

Browse files
committed
♻ Refactorisation Planning
1 parent 76f5fc6 commit 4f0a944

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/fr/umontp/edt/Planning.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private Planning() {
5050
* @param dates dates pour lesquelles on veut obtenir le planning.
5151
* @return {@code Planning} correspondant
5252
* @see Planning
53-
* @since 1.3.0
53+
* @since 1.3.1
5454
*/
5555
@Override
5656
public Planning getPlanningOf(LocalDate... dates) {
@@ -88,14 +88,15 @@ public Planning getPlanningOf(LocalDate date, Groupe groupe) {
8888
* @return planning correspondant
8989
* @see Groupe
9090
* @see Planning
91-
* @since 1.2.0
91+
* @since 1.3.1
9292
*/
9393
@Override
9494
public Planning getPlanningOf(Groupe... groupes) {
9595
Planning result = new Planning();
96-
for (Groupe groupe : groupes)
97-
result.cours.addAll(
98-
this.cours.stream().filter(c -> groupe.estContenuDans(c.getGroupes())).collect(Collectors.toSet()));
96+
for (Cours c : cours)
97+
for (Groupe g : groupes)
98+
if (g.estContenuDans(c.getGroupes()))
99+
result.cours.add(c);
99100
return result;
100101
}
101102

0 commit comments

Comments
 (0)