Code cleanup

This commit is contained in:
Stone_Red
2026-03-04 18:12:08 +01:00
parent 9e9123f58d
commit 9813426f06
5 changed files with 8 additions and 12 deletions
@@ -160,7 +160,7 @@ public class YesNtInterpreter
{
if (statementAttribute.SearchMode == SearchMode.StartOfLine && runtimeInfo.CurrentLine.StartsWith(name))
{
string copyLine = statementAttribute.KeepStatementInArgs ? runtimeInfo.CurrentLine : runtimeInfo.CurrentLine.Remove(0, name.Length);
string copyLine = statementAttribute.KeepStatementInArgs ? runtimeInfo.CurrentLine : runtimeInfo.CurrentLine[name.Length..];
statement.Value.Invoke(copyLine);
statementFound = true;
}
@@ -172,7 +172,7 @@ public class YesNtInterpreter
}
else if (statementAttribute.SearchMode == SearchMode.EndOfLine && runtimeInfo.CurrentLine.EndsWith(name))
{
string copyLine = statementAttribute.KeepStatementInArgs ? runtimeInfo.CurrentLine : runtimeInfo.CurrentLine.Remove(runtimeInfo.CurrentLine.Length - name.Length);
string copyLine = statementAttribute.KeepStatementInArgs ? runtimeInfo.CurrentLine : runtimeInfo.CurrentLine[..^name.Length];
statement.Value.Invoke(copyLine);
statementFound = true;
}