diff options
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService')
3 files changed, 13 insertions, 22 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs index 383ad006..f0970d16 100644 --- a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs +++ b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs @@ -4,23 +4,20 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator.NotificationService { public sealed class NotificationEventHandler { - private static NotificationEventHandler instance; - private static object instanceLock = new object(); + private static NotificationEventHandler _instance; + private static readonly object _instanceLock = new(); - private INotificationService[] _registry; + private readonly INotificationService[] _registry; public static NotificationEventHandler Instance { get { - lock (instanceLock) + lock (_instanceLock) { - if (instance == null) - { - instance = new NotificationEventHandler(); - } + _instance ??= new NotificationEventHandler(); - return instance; + return _instance; } } } @@ -61,10 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator.NotificationService { for (int i = 0; i < _registry.Length; i++) { - if (_registry[i] != null) - { - _registry[i].SignalFriendListUpdate(targetId); - } + _registry[i]?.SignalFriendListUpdate(targetId); } } @@ -73,11 +67,8 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator.NotificationService { for (int i = 0; i < _registry.Length; i++) { - if (_registry[i] != null) - { - _registry[i].SignalNewFriendRequest(targetId); - } + _registry[i]?.SignalNewFriendRequest(targetId); } } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationEventType.cs b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationEventType.cs index 5136ae8a..d7f3f55d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationEventType.cs +++ b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationEventType.cs @@ -2,8 +2,8 @@ { enum NotificationEventType : uint { - Invalid = 0x0, + Invalid = 0x0, FriendListUpdate = 0x1, - NewFriendRequest = 0x65 + NewFriendRequest = 0x65, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationInfo.cs b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationInfo.cs index e710bf06..1073c47d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationInfo.cs +++ b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/Types/NotificationInfo.cs @@ -10,4 +10,4 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator.NotificationService private Array4<byte> _padding; public long NetworkUserIdPlaceholder; } -}
\ No newline at end of file +} |
