Speed up text retrieval

Linq toarray kinda slow
This commit is contained in:
Kurt
2016-11-20 14:56:30 -08:00
parent 3c2eba7970
commit c920a1b589

View File

@@ -76,7 +76,8 @@ public string[] Lines
LineInfo[] lines = LineOffsets;
for (int i = 0; i < lines.Length; i++)
{
byte[] EncryptedLineData = Data.Skip(lines[i].Offset).Take(lines[i].Length * 2).ToArray();
byte[] EncryptedLineData = new byte[lines[i].Length * 2];
Array.Copy(Data, lines[i].Offset, EncryptedLineData, 0, EncryptedLineData.Length);
byte[] DecryptedLineData = cryptLineData(EncryptedLineData, key);
result[i] = getLineString(DecryptedLineData);
key += KEY_ADVANCE;