File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
src/Pharmacist.Core/Utilities Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -77,18 +77,8 @@ internal static class AssemblyHelpers
7777
7878 private static string FindClosestVersionDirectory ( string basePath , Version version )
7979 {
80- string ? path = null ;
81- foreach ( var ( versionFolder , name ) in new DirectoryInfo ( basePath )
82- . EnumerateDirectories ( )
83- . Select ( d => ConvertToVersion ( d . Name ) )
84- . Where ( v => v . Version != null )
85- . OrderBy ( v => v . Version ) )
86- {
87- if ( path == null || versionFolder >= version )
88- {
89- path = name ;
90- }
91- }
80+ var directory = new DirectoryInfo ( basePath ) ;
81+ string ? path = directory . EnumerateDirectories ( ) . Select ( d => ConvertToVersion ( d . Name ) ) . Where ( x => x . Version is not null && x . Version == version ) . Select ( x => x . Name ) . FirstOrDefault ( ) ;
9282
9383 return path ?? version . ToString ( ) ;
9484 }
You can’t perform that action at this time.
0 commit comments