@@ -1994,21 +1994,20 @@ Locale& Locale::init(StringPiece localeID, UBool canonicalize)
1994
1994
U_ASSERT (fullNameBuffer.isEmpty ());
1995
1995
nest.init (language, script, region, variantBegin);
1996
1996
} else {
1997
- std::unique_ptr<Heap>& heap = payload.emplace <std::unique_ptr<Heap>>(
1998
- std::make_unique<Heap>(language, script, region, variantBegin));
1999
- if (!heap) {
2000
- break ; // error: out of memory
2001
- }
2002
1997
if (fullName == nest.baseName ) {
2003
1998
U_ASSERT (fullNameBuffer.isEmpty ());
2004
- heap-> fullName = {fullName, static_cast <std::string_view::size_type>(length)};
2005
- if (heap-> fullName .isEmpty ()) {
1999
+ fullNameBuffer = {fullName, static_cast <std::string_view::size_type>(length)};
2000
+ if (fullNameBuffer .isEmpty ()) {
2006
2001
break ; // error: out of memory
2007
2002
}
2008
- } else {
2009
- U_ASSERT (!fullNameBuffer.isEmpty ());
2010
- heap->fullName = std::move (fullNameBuffer);
2011
2003
}
2004
+ std::unique_ptr<Heap>& heap = payload.emplace <std::unique_ptr<Heap>>(
2005
+ std::make_unique<Heap>(language, script, region, variantBegin));
2006
+ if (!heap) {
2007
+ break ; // error: out of memory
2008
+ }
2009
+ U_ASSERT (!fullNameBuffer.isEmpty ());
2010
+ heap->fullName = std::move (fullNameBuffer);
2012
2011
}
2013
2012
2014
2013
initBaseName (err);
0 commit comments