Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit fdd7d8d

Browse files
Simplifying logic
1 parent 2c113e3 commit fdd7d8d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/GitHub.InlineReviews/Tags/InlineCommentTagger.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,15 @@ public IEnumerable<ITagSpan<InlineCommentTag>> GetTags(NormalizedSnapshotSpanCol
131131
if (annotations != null)
132132
{
133133
var hasFailure = annotations.Any(model => model.AnnotationLevel == CheckAnnotationLevel.Failure);
134-
var hasWarning = !hasFailure && annotations.Any(model => model.AnnotationLevel == CheckAnnotationLevel.Warning);
135-
136-
summaryAnnotationLevel = hasFailure ? CheckAnnotationLevel.Failure :
137-
hasWarning ? CheckAnnotationLevel.Warning : CheckAnnotationLevel.Notice;
134+
if (hasFailure)
135+
{
136+
summaryAnnotationLevel = CheckAnnotationLevel.Failure;
137+
}
138+
else
139+
{
140+
var hasWarning = annotations.Any(model => model.AnnotationLevel == CheckAnnotationLevel.Warning);
141+
summaryAnnotationLevel = hasWarning ? CheckAnnotationLevel.Warning : CheckAnnotationLevel.Notice;
142+
}
138143
}
139144

140145
var showInlineTag = new ShowInlineCommentTag(currentSession, line, thread?.DiffLineType ?? DiffChangeType.Add)

0 commit comments

Comments
 (0)