mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-28 17:11:08 +00:00
Let the buffer grow as it pleases.
This commit is contained in:
parent
33baa8f382
commit
cfeba45c35
@ -360,7 +360,9 @@ void fmt::BasicWriter<Char>::FormatDouble(
|
|||||||
GrowBuffer(n);
|
GrowBuffer(n);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer_.reserve(n >= 0 ? offset + n + 1 : 2 * buffer_.capacity());
|
// If n is negative we ask to increase the capacity by at least 1,
|
||||||
|
// but as std::vector, the buffer grows exponentially.
|
||||||
|
buffer_.reserve(n >= 0 ? offset + n + 1 : buffer_.capacity() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user