Skip to content

Commit df95bff

Browse files
Fix CodeQL violations
1 parent fba959d commit df95bff

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/AspNet/WebApi/src/Asp.Versioning.WebApi/MediaTypeApiVersionReaderBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ public partial class MediaTypeApiVersionReaderBuilder
3333
{
3434
var parser = new RouteParser();
3535
var parsedRoute = parser.Parse( template );
36-
var parameters = from content in parsedRoute.PathSegments.OfType<IPathContentSegment>()
37-
from parameter in content.Subsegments.OfType<IPathParameterSubsegment>()
38-
select parameter;
36+
var segments = from content in parsedRoute.PathSegments.OfType<IPathContentSegment>()
37+
from segment in content.Subsegments.OfType<IPathParameterSubsegment>()
38+
select segment;
3939

40-
if ( parameters.Count() > 1 )
40+
if ( segments.Count() > 1 )
4141
{
4242
var message = string.Format( CultureInfo.CurrentCulture, CommonSR.InvalidMediaTypeTemplate, template );
4343
throw new ArgumentException( message, nameof( template ) );

src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/GroupedApiVersionDescriptionProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public GroupedApiVersionMetadata( string? groupName, ApiVersionMetadata metadata
444444
public bool Equals( GroupedApiVersionMetadata? other ) => other is not null && other.GetHashCode() == GetHashCode();
445445

446446
/// <inheritdoc />
447-
public override bool Equals( object? obj ) => obj is GroupedApiVersionMetadata other && Equals( other );
447+
public override bool Equals( object? obj ) => Equals( obj as GroupedApiVersionMetadata );
448448

449449
/// <inheritdoc />
450450
public override int GetHashCode()

0 commit comments

Comments
 (0)