From 98eae090342becd5a14f49ba4fbef83ac8320a81 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 5 Aug 2025 13:53:17 +0100 Subject: [PATCH] Simplified logic inside `ContainsActiveProfile` and added comments --- .../Services/ProfileActivityService.cs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs b/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs index 7ebfa83a..c283f43d 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ProfileActivityService.cs @@ -28,25 +28,23 @@ public class ProfileActivityService(TimeUtil timeUtil) ); } + /// + /// Does profile exist in activity cache + /// + /// Profile id to check for + /// True when profile exists in cache public bool ContainsActiveProfile(MongoId sessionId) { - if (_activeProfiles.ContainsKey(sessionId)) - { - return true; - } - - return false; + return _activeProfiles.ContainsKey(sessionId); } - // Yes this is terrible, the other alternative is re-doing half of bot-gen which is currently doing guess-work anyway + /// + /// TODO: Yes this is terrible, the other alternative is re-doing half of bot-gen which is currently doing guess-work anyway + /// + /// ProfileActivityRaidData public ProfileActivityRaidData? GetFirstProfileActivityRaidData() { - if (!_activeProfiles.IsEmpty) - { - return _activeProfiles.First().Value.RaidData; - } - - return null; + return !_activeProfiles.IsEmpty ? _activeProfiles.First().Value.RaidData : null; } public ProfileActivityRaidData GetProfileActivityRaidData(MongoId sessionId)