code_style: use ?: operator instead of if ... else statement

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-04 16:42:32 +08:00
parent 68e96f428e
commit 11af5d9b29
No known key found for this signature in database

View file

@ -1049,11 +1049,7 @@ namespace SourceGit.Views
// For the last line (selection range is within original source) // For the last line (selection range is within original source)
if (i == endIdx) if (i == endIdx)
{ {
if (endPosition.Column < line.Content.Length) builder.Append(endPosition.Column - 1 < line.Content.Length ? line.Content.Substring(0, endPosition.Column - 1) : line.Content);
builder.Append(line.Content.Substring(0, endPosition.Column - 1));
else
builder.Append(line.Content);
break; break;
} }