mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-24 03:34:21 -05:00
Selectively TrimEnd without extra robust logic
TrimEnd has some loops and stuff which isn't necessary for single-char, single-time trims
This commit is contained in:
@@ -143,7 +143,14 @@ public static string[] LoadStringList(string file, string? txt)
|
||||
return Array.Empty<string>();
|
||||
string[] raw = txt.Split('\n');
|
||||
for (int i = 0; i < raw.Length; i++)
|
||||
raw[i] = raw[i].TrimEnd('\r');
|
||||
{
|
||||
var line = raw[i];
|
||||
if (line.Length == 0)
|
||||
continue;
|
||||
var last = line.Length - 1;
|
||||
if (line[last] == '\r')
|
||||
raw[i] = line.Substring(0, last);
|
||||
}
|
||||
|
||||
lock (getStringListLoadLock) // Make sure only one thread can write to the cache
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user