A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/vssetup.powershell/commit/0f58b5c44c2685112e237209c648e84d8fd42b45 below:

Properly sort instances for -Latest · microsoft/vssetup.powershell@0f58b5c · GitHub

File tree Expand file treeCollapse file tree 4 files changed

+8

-9

lines changed

Filter options

Expand file treeCollapse file tree 4 files changed

+8

-9

lines changed Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

"installationName": "VisualStudio/public.d15rel/15.0.26116.0",

4 4

"installationVersion": "15.0.26116",

5 5

"installationPath": "C:\\VS\\Community",

6 -

"installDate": "2017-01-17T03:45:00Z",

6 +

"installDate": "2017-01-18T03:45:00Z",

7 7

"product": {

8 8

"id": "Microsoft.VisualStudio.Product.Community",

9 9

"version": "15.0.26116.0",

Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

"installationName": "VisualStudio/public.d15rel/15.0.26117.0",

4 4

"installationVersion": "15.0.26117",

5 5

"installationPath": "C:\\VS\\Enterprise",

6 -

"installDate": "2017-01-18T03:15:00Z",

6 +

"installDate": "2017-01-17T03:15:00Z",

7 7

"product": {

8 8

"id": "Microsoft.VisualStudio.Product.Enterprise",

9 9

"version": "15.0.26117.0",

Original file line number Diff line number Diff line change

@@ -139,17 +139,14 @@ bool Contains(IEnumerable<PackageReference> packages, Func<PackageReference, str

139 139

select instance;

140 140

}

141 141 142 -

if (Latest)

143 -

{

144 -

// Sort by the InstallationVersion then InstallDate so we can easily find the latest.

145 -

instances = instances.OrderBy(instance => instance, InstanceComparer.VersionAndDate);

146 -

}

147 - 148 142

foreach (var instance in instances)

149 143

{

150 144

if (Latest)

151 145

{

152 -

latestInstance = instance;

146 +

if (latestInstance == null || InstanceComparer.VersionAndDate.Compare(latestInstance, instance) < 0)

147 +

{

148 +

latestInstance = instance;

149 +

}

153 150

}

154 151

else

155 152

{

Original file line number Diff line number Diff line change

@@ -45,6 +45,8 @@ public static IEnumerable<object[]> GetCompareVersionAndDateData()

45 45

new object[] { Mock(v1), Mock(v1), 0 },

46 46

new object[] { Mock(v1), Mock(v2), -1 },

47 47

new object[] { Mock(v2), Mock(v1), 1 },

48 +

new object[] { Mock(v1, ft2), Mock(v2, ft1), -1 },

49 +

new object[] { Mock(v2, ft1), Mock(v1, ft2), 1 },

48 50

new object[] { Mock(v2, ft1), Mock(v2, ft2), -1 },

49 51

new object[] { Mock(v2, ft2), Mock(v2, ft1), 1 },

50 52

};

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4