Skip to content

Commit 7101668

Browse files
committed
Code Cleanup
1 parent bff1c75 commit 7101668

6 files changed

Lines changed: 9 additions & 15 deletions

File tree

Core/Models/AutoSave.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Upsilon.Apps.Passkey.Core.Utils;
22
using Upsilon.Apps.Passkey.Interfaces.Enums;
3-
using Upsilon.Apps.Passkey.Interfaces.Models;
43

54
namespace Upsilon.Apps.Passkey.Core.Models
65
{

Core/Models/Database.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using Upsilon.Apps.Passkey.Core.Utils;
1+
using Upsilon.Apps.Passkey.Core.Utils;
32
using Upsilon.Apps.Passkey.Interfaces.Enums;
43
using Upsilon.Apps.Passkey.Interfaces.Events;
54
using Upsilon.Apps.Passkey.Interfaces.Models;

Core/Models/Log.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Security.AccessControl;
2-
using Upsilon.Apps.Passkey.Core.Utils;
1+
using Upsilon.Apps.Passkey.Core.Utils;
32
using Upsilon.Apps.Passkey.Interfaces.Enums;
43
using Upsilon.Apps.Passkey.Interfaces.Models;
54

@@ -58,7 +57,7 @@ public Log(Database database, string log)
5857

5958
public override string ToString()
6059
{
61-
return $"{DateTimeTicks}|{((int)EventType)}|{(NeedsReview ? "1" : "")}|{string.Join("|", Data)}";
60+
return $"{DateTimeTicks}|{(int)EventType}|{(NeedsReview ? "1" : "")}|{string.Join("|", Data)}";
6261
}
6362

6463
private string _buildMessage()

Core/Models/User.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.ComponentModel;
1+
using System.ComponentModel;
32
using Upsilon.Apps.Passkey.Core.Utils;
43
using Upsilon.Apps.Passkey.Interfaces.Enums;
54
using Upsilon.Apps.Passkey.Interfaces.Models;
@@ -217,7 +216,7 @@ private void _timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
217216

218217
if (_clipboardLeftTime == 0)
219218
{
220-
Database.ClipboardManager.RemoveAllOccurence([.. Services.SelectMany(x => x.Accounts).SelectMany(x => x.Passwords.Values)]);
219+
_ = Database.ClipboardManager.RemoveAllOccurence([.. Services.SelectMany(x => x.Accounts).SelectMany(x => x.Passwords.Values)]);
221220
_clipboardLeftTime = CleaningClipboardTimeout;
222221
}
223222
}

Core/Utils/FileLocker.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ private string _readContent(string fileEntry, string[] passkeys)
140140
using Stream stream = zipEntry.Open();
141141
using StreamReader reader = new(stream, Encoding.UTF8);
142142

143-
if (passkeys.Length != 0)
144-
content = _cryptographicCenter.DecryptSymmetrically(_decompressString(reader.ReadToEnd()), passkeys);
145-
else
146-
content = _decompressString(reader.ReadToEnd());
143+
content = passkeys.Length != 0
144+
? _cryptographicCenter.DecryptSymmetrically(_decompressString(reader.ReadToEnd()), passkeys)
145+
: _decompressString(reader.ReadToEnd());
147146
}
148147

149148
Lock();

Core/Utils/LogCenter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Text.Json.Serialization;
2-
using Upsilon.Apps.Passkey.Core.Models;
1+
using Upsilon.Apps.Passkey.Core.Models;
32
using Upsilon.Apps.Passkey.Interfaces.Enums;
43
using Upsilon.Apps.Passkey.Interfaces.Models;
54

0 commit comments

Comments
 (0)