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

Unused vars cleanup in System.DirectoryServices.csproj and System.Configuration.ConfigurationManager.csproj #34975

Closed
wants to merge 0 commits into from

Conversation

pviotti
Copy link

@pviotti pviotti commented Apr 14, 2020

As per #30457, remove some unused local variables in the System.DirectoryServices.csproj and System.Configuration.ConfigurationManager.csproj projects.

Variables not removed because it looks like they might trigger some useful side effects:

  • ActiveDirectorySite.cs(422,36): warning S1481: Remove the unused local variable 'tmp'.

              if (existing)
              {
                  // for existing site, nTDSSiteSettings needs to exist
                  DirectoryEntry tmp = NTDSSiteEntry;
              }
    
  • System\DirectoryServices\ActiveDirectory\DirectoryServer.cs(112,28): warning S1481: Remove the unused local variable 'dn'.

                 // force binding (needed otherwise S.DS throw an exception while releasing the COM interface pointer)
                 string dn = (string)PropertyManager.GetPropertyValue(context, serverEntry, PropertyManager.DistinguishedName);
    
  • System\DirectoryServices\ActiveDirectory\GlobalCatalog.cs(266,34): warning S1481: Remove the unused local variable 'schemaContext'.

             DirectoryContext schemaContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context);
    

@@ -726,7 +726,6 @@ private object GetPropertyValue(string propertyName)
}
}

object temp = base[propertyName];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible this was being used for any kind of argument validation? There are a variety of checks that result in throwing exceptions in the base method.

@stephentoub
Copy link
Member

@pviotti, are you still working on this? Can you rebase on the current master to address the merge conflicts? Thanks.

@pviotti pviotti closed this Sep 16, 2020
@pviotti pviotti force-pushed the unused-vars-cleanup branch from c80ca3c to 81f52e9 Compare September 16, 2020 16:42
@dotnet dotnet deleted a comment from dnfclas Sep 16, 2020
@pviotti
Copy link
Author

pviotti commented Sep 16, 2020

Looks like all my changes have been already merged by other PRs in the meantime. Oh well.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants