diff options
author | Eike Rathke <erack@redhat.com> | 2013-08-07 11:20:59 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-08-07 12:02:58 +0200 |
commit | 6b2aaa7d2393db7c5df9ed3e695013b1e44d868f (patch) | |
tree | 56e06f8cf7ccfffc6f86e1102d67cfb2cd0ef39d /scripting | |
parent | 18767fd249bce1c6ad9d42d02de32757fd93e053 (diff) |
resolved fdo#67444 don't push_back() with already reserved size
Change-Id: I5660bdf07ad0adae053508bed1805369850c1134
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 7a80699bcb3b..253d77bc1684 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -687,10 +687,11 @@ LocaleItem* StringResourceImpl::getClosestMatchItemForLocale( const Locale& loca LocaleItem* pRetItem = NULL; ::std::vector< Locale > aLocales( m_aLocaleItemVector.size()); - for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it ) + size_t i = 0; + for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it, ++i ) { LocaleItem* pLocaleItem = *it; - aLocales.push_back( pLocaleItem ? pLocaleItem->m_locale : Locale()); + aLocales[i] = (pLocaleItem ? pLocaleItem->m_locale : Locale()); } ::std::vector< Locale >::const_iterator iFound( LanguageTag::getMatchingFallback( aLocales, locale)); if (iFound != aLocales.end()) |