From 68aeabe8c100ba8382fe127b8eea98b3817b3f73 Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Fri, 12 Jan 2024 08:10:54 +0100 Subject: [PATCH] Fix typo --- Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs b/Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs index f63a8524..17b39b05 100644 --- a/Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs +++ b/Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs @@ -51,12 +51,11 @@ private void CheckForObjectIdsInFunctionInvocations(OperationAnalysisContext con { if (operation.TargetMethod.Parameters[0].ParameterType.NavTypeKind == NavTypeKind.Integer) { - int tempint = 0; - if (int.TryParse(operation.Arguments[0].Syntax.ToString(), out tempint)) - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0012DoNotUseObjectIdInSystemFunctions, context.Operation.Syntax.GetLocation(), new object[] { "CurrentFunction.CorrectAccessSymbol", "" })); + if (int.TryParse(operation.Arguments[0].Syntax.ToString(), out int tempint)) + context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0012DoNotUseObjectIdInSystemFunctions, context.Operation.Syntax.GetLocation(), new object[] { CurrentFunction.CorrectAccessSymbol, "" })); else if (!operation.Arguments[0].Syntax.ToString().ToUpper().StartsWith(CurrentFunction.CorrectAccessSymbol.ToUpper())) - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0012DoNotUseObjectIdInSystemFunctions, context.Operation.Syntax.GetLocation(), new object[] { "CurrentFunction.CorrectAccessSymbol", "" })); + context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0012DoNotUseObjectIdInSystemFunctions, context.Operation.Syntax.GetLocation(), new object[] { CurrentFunction.CorrectAccessSymbol, "" })); } } }