From 7e6edbadedaaa814885ddf6399d99cbad1a357bf Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 11 Jan 2020 14:18:11 -0800 Subject: [PATCH] Remove unnecessary constructor Make key readonly --- PKHeX.Core/Saves/MemeCrypto/SwishCrypto.cs | 5 ++--- PKHeX.Core/Saves/Substructures/Gen8/Meta8.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Saves/MemeCrypto/SwishCrypto.cs b/PKHeX.Core/Saves/MemeCrypto/SwishCrypto.cs index cb6a0e374..c0ddffc5d 100644 --- a/PKHeX.Core/Saves/MemeCrypto/SwishCrypto.cs +++ b/PKHeX.Core/Saves/MemeCrypto/SwishCrypto.cs @@ -151,7 +151,7 @@ public sealed class SCBlock : BlockInfo /// /// Used to encrypt the rest of the block. /// - public uint Key { get; set; } + public readonly uint Key; /// /// What kind of block is it? @@ -168,8 +168,7 @@ public sealed class SCBlock : BlockInfo /// public byte[] Data = Array.Empty(); - private SCBlock(uint key) => Key = key; - internal SCBlock() { } + internal SCBlock(uint key) => Key = key; protected override bool ChecksumValid(byte[] data) => true; protected override void SetChecksum(byte[] data) { } diff --git a/PKHeX.Core/Saves/Substructures/Gen8/Meta8.cs b/PKHeX.Core/Saves/Substructures/Gen8/Meta8.cs index c81264139..4b5b84126 100644 --- a/PKHeX.Core/Saves/Substructures/Gen8/Meta8.cs +++ b/PKHeX.Core/Saves/Substructures/Gen8/Meta8.cs @@ -12,7 +12,7 @@ private static SCBlock[] GetBlankBlockArray(IReadOnlyList arr) for (int i = 0; i < blocks.Length; i++) { int index = i * 2; - blocks[i] = new SCBlock { Key = arr[index], Data = new byte[(int)arr[index + 1]] }; + blocks[i] = new SCBlock(arr[index]) { Data = new byte[(int)arr[index + 1]] }; } return blocks;