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

Sorted dependencies #83

Merged
merged 4 commits into from
Jun 18, 2018
Merged

Conversation

artofcode
Copy link
Contributor

With a lot of dependencies, it becomes a bit cluttered, sorting by bundle name makes it a lot easier to navigate

Copy link
Contributor

@BrettKercher BrettKercher left a comment

Choose a reason for hiding this comment

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

Left a small suggestion to simplify the code a bit, but besides that this change looks good. Having nicely organized information is always a good thing!

@@ -176,7 +177,8 @@ internal IEnumerable<MessageSystem.Message> GetMessages()
if (m_dependencies != null && m_dependencies.Count > 0)
{
var message = string.Empty;
foreach (var dependent in m_dependencies)
List<AssetInfo> sortedDependencies = m_dependencies.OrderBy(d => d.bundleName).ToList();
Copy link
Contributor

Choose a reason for hiding this comment

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

The .ToList() is redundant, since the foreach will work with the default return value of OrderBy. We also tend to use var for local variables - so this could be simplified just a bit to var sortedDependencies = m_dependencies.OrderBy(d => d.bundleName);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, those are good points. I've updated them to keep it consistent with the rest!

using var and skipping the .ToList() as per feedback
@BrettKercher BrettKercher merged commit 489bdf6 into Unity-Technologies:master Jun 18, 2018
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.

2 participants