Skip to content

Commit a62ef0c

Browse files
committed
Model: cache linkedName calculation
1 parent 905808b commit a62ef0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/model.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ abstract class ModelElement implements Comparable, Nameable, Documentable {
8787
String _rawDocs;
8888
Documentation __documentation;
8989
List _parameters;
90+
String _linkedName;
9091

9192
String _fullyQualifiedName;
9293

@@ -309,6 +310,13 @@ abstract class ModelElement implements Comparable, Nameable, Documentable {
309310
(this is Library) ? (this as Library).package : this.library.package;
310311

311312
String get linkedName {
313+
if (_linkedName == null) {
314+
_linkedName = _calculateLinkedName();
315+
}
316+
return _linkedName;
317+
}
318+
319+
String _calculateLinkedName() {
312320
if (name.startsWith('_')) {
313321
return HTML_ESCAPE.convert(name);
314322
}

0 commit comments

Comments
 (0)