File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,22 @@ export function webviewUriToFileUri(webviewUri: string): Uri {
8686 return Uri . file ( path ) ;
8787}
8888
89+ function sortMultiplier ( sortDirection : SortDirection ) : number {
90+ switch ( sortDirection ) {
91+ case SortDirection . asc : return 1 ;
92+ case SortDirection . desc : return - 1 ;
93+ }
94+ }
95+
8996function sortInterpretedResults ( results : Sarif . Result [ ] , sortState : InterpretedResultsSortState | undefined ) : void {
9097 if ( sortState !== undefined ) {
91- const direction = sortState . sortDirection === SortDirection . asc ? 1 : - 1 ;
98+ const multiplier = sortMultiplier ( sortState . sortDirection ) ;
9299 switch ( sortState . sortBy ) {
93100 case 'alert-message' :
94101 results . sort ( ( a , b ) =>
95102 a . message . text === undefined ? 0 :
96103 b . message . text === undefined ? 0 :
97- direction * ( a . message . text ?. localeCompare ( b . message . text ) ) ) ;
104+ multiplier * ( a . message . text ?. localeCompare ( b . message . text ) ) ) ;
98105 break ;
99106 default :
100107 assertNever ( sortState . sortBy ) ;
You can’t perform that action at this time.
0 commit comments