Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PVS-Studio issues related to 'CognitiveServices' #14372

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@ public class RemoveExpressRouteConnectionCommand : ExpressRouteConnectionBaseCmd

public override void Execute()
{
if (ParameterSetName.Equals(CortexParameterSetNames.ByExpressRouteConnectionName, StringComparison.OrdinalIgnoreCase))
{
this.ResourceGroupName = this.ResourceGroupName;
this.ExpressRouteGatewayName = this.ExpressRouteGatewayName;
this.Name = this.Name;
}
else if (ParameterSetName.Equals(CortexParameterSetNames.ByExpressRouteConnectionObject, StringComparison.OrdinalIgnoreCase))
if (ParameterSetName.Equals(CortexParameterSetNames.ByExpressRouteConnectionObject, StringComparison.OrdinalIgnoreCase))
{
this.ResourceId = this.InputObject.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@ public partial class AddAzureRmLoadBalancerBackendAddressPoolConfigCommand : Net

public override void Execute()
{
// BackendAddressPools
if (this.LoadBalancer.BackendAddressPools == null)
{
this.LoadBalancer.BackendAddressPools = new List<PSBackendAddressPool>();
}

var existingBackendAddressPool = this.LoadBalancer.BackendAddressPools.SingleOrDefault(resource => string.Equals(resource.Name, this.Name, System.StringComparison.CurrentCultureIgnoreCase));
if (existingBackendAddressPool != null)
{
throw new ArgumentException("BackendAddressPool with the specified name already exists");
}

// BackendAddressPools
if (this.LoadBalancer.BackendAddressPools == null)
{
this.LoadBalancer.BackendAddressPools = new List<PSBackendAddressPool>();
}

var vBackendAddressPools = new PSBackendAddressPool();

vBackendAddressPools.Name = this.Name;
Expand Down