Skip to content

Commit b1c9b25

Browse files
committed
Fix TryGetSemanticModel usage
1 parent ba8ee0b commit b1c9b25

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/ElementOrderCodeFixProvider.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
6767
private static async Task<ElementOrderingChecks> GetEnabledRulesForDocumentAsync(Document document, CancellationToken cancellationToken)
6868
{
6969
SemanticModel semanticModel;
70-
document.TryGetSemanticModel(out semanticModel);
71-
if (semanticModel == null)
70+
if (!document.TryGetSemanticModel(out semanticModel))
7271
{
7372
semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
7473
}

0 commit comments

Comments
 (0)