Skip to content

Commit 36c9ea5

Browse files
committed
Obtain global tag prefix in one pass
1 parent 11a1044 commit 36c9ea5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkgs/yaml/lib/src/scanner.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,11 +937,9 @@ class Scanner {
937937
/// Both tag uri and local tags can be used as prefixes.
938938
///
939939
/// See: https://yaml.org/spec/1.2.2/#6822-tag-prefixes
940-
var prefix = _scanner.peekChar() == EXCLAMATION
940+
final prefix = _scanner.peekChar() == EXCLAMATION
941941
? _scanTagHandle(directive: true, isGlobalTagPrefix: true).tagHandle
942-
: '';
943-
944-
prefix += _scanTagUri(); // Readability's sake
942+
: _scanTagUri();
945943

946944
if (prefix.isEmpty) {
947945
throw YamlException(

0 commit comments

Comments
 (0)