Skip to content

Commit

Permalink
Fix CodeQL violations
Browse files Browse the repository at this point in the history
  • Loading branch information
commonsensesoftware committed Nov 8, 2022
1 parent fba959d commit df95bff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public partial class MediaTypeApiVersionReaderBuilder
{
var parser = new RouteParser();
var parsedRoute = parser.Parse( template );
var parameters = from content in parsedRoute.PathSegments.OfType<IPathContentSegment>()
from parameter in content.Subsegments.OfType<IPathParameterSubsegment>()
select parameter;
var segments = from content in parsedRoute.PathSegments.OfType<IPathContentSegment>()
from segment in content.Subsegments.OfType<IPathParameterSubsegment>()
select segment;

if ( parameters.Count() > 1 )
if ( segments.Count() > 1 )
{
var message = string.Format( CultureInfo.CurrentCulture, CommonSR.InvalidMediaTypeTemplate, template );
throw new ArgumentException( message, nameof( template ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public GroupedApiVersionMetadata( string? groupName, ApiVersionMetadata metadata
public bool Equals( GroupedApiVersionMetadata? other ) => other is not null && other.GetHashCode() == GetHashCode();

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

/// <inheritdoc />
public override int GetHashCode()
Expand Down

0 comments on commit df95bff

Please sign in to comment.