Skip to content

Commit c665482

Browse files
committed
Improve code quality
1 parent c3c6126 commit c665482

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Flow.Launcher/Storage/TopMostRecord.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ public class TopMostRecord
1212

1313
internal bool IsTopMost(Result result)
1414
{
15-
if (records.IsEmpty || (result.OriginQuery != null && !records.ContainsKey(result.OriginQuery.RawQuery)))
15+
if (records.IsEmpty || result.OriginQuery == null ||
16+
!records.TryGetValue(result.OriginQuery.RawQuery, out var value))
1617
{
1718
return false;
1819
}
1920

2021
// since this dictionary should be very small (or empty) going over it should be pretty fast.
21-
return result.OriginQuery != null && records[result.OriginQuery.RawQuery].Equals(result);
22+
return value.Equals(result);
2223
}
2324

2425
internal void Remove(Result result)

0 commit comments

Comments
 (0)