optimize: make the domain map the correct size when initialized

This commit is contained in:
Jon Snyder 2020-10-28 16:11:06 -07:00
parent 69291164ca
commit a1f059fb62

View file

@ -403,7 +403,7 @@ func (do *Domain) GetNC(str, plural string, n int, ctx string, vars ...interface
//GetTranslations returns a copy of every translation in the domain. It does not support contexts.
func (do *Domain) GetTranslations() map[string]*Translation {
all := make(map[string]*Translation)
all := make(map[string]*Translation, len(do.translations))
do.trMutex.RLock()
defer do.trMutex.RUnlock()