-
Notifications
You must be signed in to change notification settings - Fork 64
GetBundleVersion: Parse versions correctly to avoid duplicates or incomplete versions #324
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,13 +113,17 @@ public static Dictionary<Bundle, string> GetReasonRequiredStrings(IEnumerable<Bu | |
| foreach (var division in bundlesByDivisions) | ||
| { | ||
| var requiredBundle = division.Key.Max(); | ||
| requirementStringResults = requirementStringResults.Append((requiredBundle, division.Value)); | ||
| requirementStringResults = requirementStringResults.Concat(division.Key | ||
| .Where(bundle => !bundle.Equals(requiredBundle)) | ||
| .Select(bundle => (bundle, string.Empty))); | ||
| requirementStringResults = requirementStringResults.Concat([ | ||
| (requiredBundle, division.Value), | ||
| ..division.Key | ||
| .Where(bundle => !bundle.Equals(requiredBundle)) | ||
| .Select(bundle => (bundle, string.Empty)) | ||
| ]); | ||
| } | ||
|
|
||
| return requirementStringResults | ||
| .GroupBy(pair => pair.bundle) | ||
| .Select(group => group.First()) // Remove duplicates | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does ordering matter in a dictionary? I think these are real duplicates and can't have different values. Is that correct?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, although potential duplicates might arise as well from unforseen cases with the regex. So just playing it safe just in case as this exception would not be handled |
||
| .OrderByDescending(pair => pair.bundle.DisplayName) | ||
| .ToDictionary(i => i.bundle, i => i.Item2); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.