Skip to content

tidy: Remove outdated #ifdef logic, remove unused utility code.#388

Open
jafin wants to merge 2 commits into
ClosedXML:developfrom
jafin:tidy/conditionals
Open

tidy: Remove outdated #ifdef logic, remove unused utility code.#388
jafin wants to merge 2 commits into
ClosedXML:developfrom
jafin:tidy/conditionals

Conversation

@jafin

@jafin jafin commented May 2, 2025

Copy link
Copy Markdown
Contributor

This pull request removes unused or outdated code and improves code quality in the ClosedXML.Report.Utils namespace. The changes primarily focus on cleaning up redundant methods, modernizing syntax, and improving parameter validation.

Code cleanup and removal of unused methods:

  • Removed numerous unused extension methods from EnumExtensions, including GetString, GetStrings, ToEnum, and others. These methods were either redundant or not used in the current codebase.
  • Removed unused methods such as ToType, GetPropertyInfo, IsAssignableToGenericType, and others from TypeExtensions. These methods were no longer relevant or needed. [1] [2]

Syntax improvements:

  • Simplified the initialization of the NumericTypes HashSet in TypeExtensions using modern C# syntax.
  • Replaced string literals with nameof for argument validation in EnumExtensions to improve maintainability and reduce potential errors.

Platform-specific code removal:

  • Removed conditional compilation directives (#if !WindowsCE and #if !NET40) from EnumExtensions and VernoStringReader as they are no longer relevant. [1] [2] [3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant