We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Manager.cs
if (textSearch != null) { if (def.Name.IndexOf(textSearch, StringComparison.OrdinalIgnoreCase) < 0 || def.Description.IndexOf(textSearch, StringComparison.OrdinalIgnoreCase) < 0) { continue; } }
Name
Description
The logic can be updated to:
&&
||
Here’s the revised code:
if (textSearch != null) { if (def.Name.IndexOf(textSearch, StringComparison.OrdinalIgnoreCase) < 0 && (string.IsNullOrEmpty(def.Description) || def.Description.IndexOf(textSearch, StringComparison.OrdinalIgnoreCase) < 0)) { continue; } }
This ensures that the filtering logic meets the requirement of "matching either condition to include the entry."
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Original Code in
Manager.cs
Issue
Name
orDescription
does not match the search term.Description
.Proposed Solution
The logic can be updated to:
&&
instead of||
.Description
is either empty or does not match the search term.Here’s the revised code:
Explanation
Name
does not contain the search term.Description
is either empty or does not contain the search term.Name
orDescription
, ensuring the functionality is more flexible.Improved Behavior
Name
does not match, the entry is skipped regardless of whetherDescription
matches or not.Name
does not match, theDescription
is still checked. If it matches, the entry is not skipped.This ensures that the filtering logic meets the requirement of "matching either condition to include the entry."
The text was updated successfully, but these errors were encountered: