Skip to content

Commit 11af5d9

Browse files
committed
code_style: use ?: operator instead of if ... else statement
Signed-off-by: leo <[email protected]>
1 parent 68e96f4 commit 11af5d9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Views/TextDiffView.axaml.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,11 +1049,7 @@ private void CopyWithoutIndicators()
10491049
// For the last line (selection range is within original source)
10501050
if (i == endIdx)
10511051
{
1052-
if (endPosition.Column < line.Content.Length)
1053-
builder.Append(line.Content.Substring(0, endPosition.Column - 1));
1054-
else
1055-
builder.Append(line.Content);
1056-
1052+
builder.Append(endPosition.Column - 1 < line.Content.Length ? line.Content.Substring(0, endPosition.Column - 1) : line.Content);
10571053
break;
10581054
}
10591055

0 commit comments

Comments
 (0)