From 9edcebb2f571e607db810d55ffe3b00518a0afa3 Mon Sep 17 00:00:00 2001 From: Nightblade73 Date: Fri, 19 Apr 2019 14:29:08 +0400 Subject: [PATCH] #69 changed isCurrentUserParticipant --- .../ru/ulstu/conference/service/ConferenceService.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/ru/ulstu/conference/service/ConferenceService.java b/src/main/java/ru/ulstu/conference/service/ConferenceService.java index a9e3fac..1bfdebd 100644 --- a/src/main/java/ru/ulstu/conference/service/ConferenceService.java +++ b/src/main/java/ru/ulstu/conference/service/ConferenceService.java @@ -134,11 +134,6 @@ public class ConferenceService { public boolean isCurrentUserParticipant(List conferenceUsers) { - for (ConferenceUser participant : conferenceUsers) { - if (participant.getUser().getId() == userService.getCurrentUser().getId()) { - return true; - } - } - return false; + return conferenceUsers.stream().anyMatch(participant -> participant.getUser().equals(userService.getCurrentUser())); } }