Skip to content

Improve performance of XmlDependencies IsDependenciesFile #602

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Refactor IsDependenciesFile
  • Loading branch information
chrisyarbrough committed Feb 9, 2024
commit 22d1a09c9615a054945664c77c9d54c12e8382df
8 changes: 5 additions & 3 deletions source/AndroidResolver/src/XmlDependencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ internal class XmlDependencies {
/// <summary>
/// Determines whether a filename matches an XML dependencies file.
/// </summary>
/// <param name="filename"></param>
/// <returns>true if it is a match, false otherwise.</returns>
internal static bool IsDependenciesFile(string filename) {
bool isInEditorFolder = filename.Contains("/Editor/") || filename.Contains(@"\Editor\");
return isInEditorFolder && filename.EndsWith("Dependencies.xml");
if (!filename.EndsWith("Dependencies.xml")) {
return false;
}

return filename.Contains("/Editor/") || filename.Contains(@"\Editor\");
}

/// <summary>
Expand Down