use conditional assignment (#9252)

This commit is contained in:
Alexandre Ardhuin
2017-04-07 21:41:17 +02:00
committed by GitHub
parent 3eb87830e9
commit 8bcf302e23
21 changed files with 30 additions and 84 deletions

View File

@@ -60,9 +60,7 @@ abstract class SyntaxHighlighter { // ignore: one_member_abstracts
class DartSyntaxHighlighter extends SyntaxHighlighter {
DartSyntaxHighlighter([this._style]) {
_spans = <_HighlightSpan>[];
if (_style == null)
_style = SyntaxHighlighterStyle.darkThemeStyle();
_style ??= SyntaxHighlighterStyle.darkThemeStyle();
}
SyntaxHighlighterStyle _style;