mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 02:26:50 -07:00
Use copy_n instead of of copy (#1897)
It is a better choice for this occasion and more performant.
This commit is contained in:
parent
6576136465
commit
095a81fecc
1 changed files with 1 additions and 2 deletions
|
@ -22,10 +22,9 @@ namespace CalcEngine
|
|||
Number::Number(PNUMBER p) noexcept
|
||||
: m_sign{ p->sign }
|
||||
, m_exp{ p->exp }
|
||||
, m_mantissa{}
|
||||
{
|
||||
m_mantissa.reserve(p->cdigit);
|
||||
copy(p->mant, p->mant + p->cdigit, back_inserter(m_mantissa));
|
||||
copy_n(p->mant, p->cdigit, back_inserter(m_mantissa));
|
||||
}
|
||||
|
||||
PNUMBER Number::ToPNUMBER() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue