intern method
Returns the canonical string equal to s; deduplicates repeated strings.
Implementation
String intern(String s) {
final String? existing = _pool[s];
if (existing != null) return existing;
if (_maxSize != null && _order != null && _order.length >= _maxSize) {
final String evict = _order.removeAt(0);
_pool.remove(evict);
}
_pool[s] = s;
_order?.add(s);
return s;
}