diff --git a/EliteBGS/DiscordLogGenerator.cs b/EliteBGS/DiscordLogGenerator.cs index d9e649d..6764622 100644 --- a/EliteBGS/DiscordLogGenerator.cs +++ b/EliteBGS/DiscordLogGenerator.cs @@ -207,7 +207,11 @@ public class DiscordLogGenerator { string[] lines = log.Split("\n"); List chunks = new(); string chunk = string.Empty; - bool done = false; + + // Optimisation + if (log.Length <= maxcount) { + return new string[] { log }; + } // First split the log into its headers // skip first bot header line diff --git a/EliteBGS/OneLineDiscordLog.cs b/EliteBGS/OneLineDiscordLog.cs index d3bebb3..9a27d3e 100644 --- a/EliteBGS/OneLineDiscordLog.cs +++ b/EliteBGS/OneLineDiscordLog.cs @@ -33,6 +33,11 @@ public class OneLineDiscordLog : DiscordLogGenerator { List chunks = new(); string chunk = string.Empty; + // Optimisation + if (log.Length <= maxcount) { + return new string[] { log }; + } + for (int i = 0; i < lines.Length; i++) { string line = lines[i]; if ((chunk.Length + line.Length) > maxcount || i == lines.Length - 1) {