Fix MAssembly classes dictionary cache allocation to be during assembly load

This commit is contained in:
Wojtek Figat
2021-01-21 14:26:52 +01:00
parent 57d7508e25
commit d93a2803cc

View File

@@ -29,7 +29,6 @@ MAssembly::MAssembly(MDomain* domain, const StringAnsiView& name, const MAssembl
, _isDependency(false)
, _isFileLocked(false)
, _hasCachedClasses(false)
, _classes(options.DictionaryInitialSize)
, _reloadCount(0)
, _name(name)
, _options(options)
@@ -342,6 +341,8 @@ void MAssembly::OnLoading()
Loading(this);
_isLoading = true;
if (_classes.Capacity() == 0)
_classes.EnsureCapacity(_options.DictionaryInitialSize);
// Pick a domain
if (_domain == nullptr)