mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-08 17:46:44 -05:00
misc optimization
list initial size is 4; oftentimes it's greater, and always padded
This commit is contained in:
@@ -146,7 +146,7 @@ public static byte[] SetString1(string value, int maxLength, bool jp, int padTo
|
||||
if (value.StartsWith(G1TradeOTStr)) // Handle "[TRAINER]"
|
||||
return new[] { dict[G1TradeOT], dict[G1Terminator] };
|
||||
|
||||
List<byte> arr = new List<byte>();
|
||||
var arr = new List<byte>(padTo);
|
||||
foreach (char c in value)
|
||||
{
|
||||
if (!dict.TryGetValue(c, out byte val))
|
||||
@@ -177,7 +177,7 @@ public static byte[] SetString2KOR(string value, int maxLength, int padTo = 0, u
|
||||
if (value.StartsWith(G1TradeOTStr)) // Handle "[TRAINER]"
|
||||
return new[] { dict[G1TradeOT], dict[G1Terminator] };
|
||||
|
||||
List<byte> arr = new List<byte>();
|
||||
var arr = new List<byte>(padTo);
|
||||
foreach (char c in value)
|
||||
{
|
||||
bool koreanChar = false;
|
||||
|
||||
Reference in New Issue
Block a user