C#: Address other CoPilot review comments.

This commit is contained in:
Michael Nebel
2026-06-03 13:57:45 +02:00
parent 0f7e36958d
commit 330b4e7ebc
2 changed files with 5 additions and 4 deletions

View File

@@ -103,9 +103,10 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
/// <summary>
/// Determines whether the given method is a slice method, which is defined as a method with
/// the name "Slice" or "SubString" and two parameters.
/// </summary> <param name="method">The method symbol to check.</param>
/// <returns>True if the method is a slice method, false otherwise.</returns>
/// the name "Slice" or "Substring" and two parameters.
/// </summary>
/// <param name="method">The method symbol to check.</param>
/// <returns>True if the method is a slice method; false otherwise.</returns>
private bool IsSliceWithRange(IMethodSymbol method, [NotNullWhen(true)] out IPropertySymbol? lengthPropertySymbol, [NotNullWhen(true)] out RangeExpressionSyntax? range)
{
range = null;

View File

@@ -1,4 +1,4 @@
---
category: minorAnalysis
---
* Improved extraction of span range-access expressions (for example, `a[0..3]`). These expressions are now extracted as span `Slice` calls.
* Improved extraction of range-access expressions on spans and strings (for example, `a[0..3]`). These expressions are now extracted as `Slice` (span) or `Substring` (string) calls.