Skip to content

Commit 2b5e4bd

Browse files
committed
chore: use if else return instead of ternary
1 parent 25285a9 commit 2b5e4bd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/adapters/outline-view-adapter.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ export default class OutlineViewAdapter {
110110
* should be converted to an {OutlineTree}.
111111
* @returns An {OutlineTree} containing the given symbols that the Outline View can display.
112112
*/
113-
public static createOutlineTrees(symbols: SymbolInformation[]): atomIde.OutlineTree[] {
114-
symbols.sort((a, b) =>
115-
a.location.range.start.line === b.location.range.start.line
116-
? a.location.range.start.character - b.location.range.start.character
117-
: a.location.range.start.line - b.location.range.start.line
118-
)
113+
public static createOutlineTrees(symbols: SymbolInformation[]): atomIde.OutlineTree[] {
114+
symbols.sort((a, b) => {
115+
if (a.location.range.start.line === b.location.range.start.line) {
116+
return a.location.range.start.character - b.location.range.start.character
117+
} else {
118+
return a.location.range.start.line - b.location.range.start.line
119+
}
120+
})
119121

120122
// Temporarily keep containerName through the conversion process
121123
// Also filter out symbols without a name - it's part of the spec but some don't include it

0 commit comments

Comments
 (0)