mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Remove unused allocation code
This commit is contained in:
parent
7a68756b2b
commit
713faeb022
1 changed files with 6 additions and 15 deletions
|
@ -207,25 +207,16 @@ PNUMBER _createnum( _In_ uint32_t size )
|
|||
|
||||
{
|
||||
PNUMBER pnumret= nullptr;
|
||||
uint32_t cbAlloc;
|
||||
|
||||
if (SUCCEEDED(Calc_ULongAdd(cbAlloc, sizeof(NUMBER), &cbAlloc)))
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
pnumret = new NUMBER();
|
||||
}
|
||||
catch (const bad_alloc&)
|
||||
{
|
||||
throw( CALC_E_OUTOFMEMORY );
|
||||
}
|
||||
// Fill mantissa vector with zeros
|
||||
pnumret->mant.insert(pnumret->mant.end(), size, 0);
|
||||
pnumret = new NUMBER();
|
||||
}
|
||||
else
|
||||
catch (const bad_alloc&)
|
||||
{
|
||||
throw( CALC_E_INVALIDRANGE );
|
||||
throw( CALC_E_OUTOFMEMORY );
|
||||
}
|
||||
// Fill mantissa vector with zeros
|
||||
pnumret->mant.insert(pnumret->mant.end(), size, 0);
|
||||
return( pnumret );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue