Skip to content

Commit 04a3d25

Browse files
content [nfc]: Inline _logError in _KatexParser._parseSpan
This will prevent string interpolation being evaluated during release build. Especially useful in later commit where it becomes more expensive.
1 parent 4231608 commit 04a3d25

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/model/katex.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ class _KatexParser {
109109
bool get hasError => _hasError;
110110
bool _hasError = false;
111111

112-
void _logError(String message) {
113-
assert(debugLog(message));
114-
_hasError = true;
115-
}
116-
117112
List<KatexNode> parseKatexHtml(dom.Element element) {
118113
assert(element.localName == 'span');
119114
assert(element.className == 'katex-html');
@@ -334,7 +329,8 @@ class _KatexParser {
334329
break;
335330

336331
default:
337-
_logError('KaTeX: Unsupported CSS class: $spanClass');
332+
assert(debugLog('KaTeX: Unsupported CSS class: $spanClass'));
333+
_hasError = true;
338334
}
339335
}
340336
final styles = KatexSpanStyles(

0 commit comments

Comments
 (0)