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