Skip to content

Commit 4d850a2

Browse files
committed
C#: Address co-pilot review comments.
1 parent eba32b9 commit 4d850a2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

csharp/extractor/Semmle.Extraction.CSharp.Util/SymbolExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public static string GetName(this ISymbol symbol, bool useMetadataName = false)
5353
});
5454

5555
/// <summary>
56-
/// The operatorname for user-defined increment and decrement operators are "op_IncrementAssignment" and
56+
/// The operatorname for user-defined instance increment- and decrement operators are "op_IncrementAssignment" and
5757
/// "op_DecrementAssignment" respectively.
5858
/// Thus we need to handle this explicitly to avoid postfixing them with an "=".
5959
/// </summary>
60-
private static bool isIncrementOrDecrement(string operatorName) => operatorName == "++" || operatorName == "--";
60+
private static bool IsIncrementOrDecrement(string operatorName) => operatorName == "++" || operatorName == "--";
6161

6262
/// <summary>
6363
/// Convert an operator method name in to a symbolic name.
@@ -79,7 +79,7 @@ public static bool TryGetOperatorSymbol(this ISymbol symbol, out string operator
7979
if (match.Success && methodToOperator.TryGetValue($"op_{match.Groups[2]}", out var rawOperatorName))
8080
{
8181
var prefix = match.Groups[1].Success ? "checked " : "";
82-
var postfix = match.Groups[3].Success && !isIncrementOrDecrement(rawOperatorName) ? "=" : "";
82+
var postfix = match.Groups[3].Success && !IsIncrementOrDecrement(rawOperatorName) ? "=" : "";
8383
operatorName = $"{prefix}{rawOperatorName}{postfix}";
8484
return true;
8585
}

csharp/ql/lib/semmle/code/csharp/exprs/Call.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ class MutatorOperatorCall extends OperatorCall {
576576
*
577577
* ```csharp
578578
* class A {
579-
* public void operator++() { ... }
579+
* public void operator ++() { ... }
580580
*
581581
* public static void Increment(A a) {
582582
* a++;

0 commit comments

Comments
 (0)