Eliminate extra copy on floating-point formatting
This commit is contained in:
@@ -102,7 +102,8 @@ TEST(FPTest, GetCachedPower) {
|
||||
|
||||
TEST(FPTest, Grisu2FormatCompilesWithNonIEEEDouble) {
|
||||
fmt::memory_buffer buf;
|
||||
grisu2_format(4.2f, buf, fmt::core_format_specs());
|
||||
int exp = 0;
|
||||
grisu2_format(4.2f, buf, fmt::core_format_specs(), exp);
|
||||
}
|
||||
|
||||
template <typename T> struct ValueExtractor : fmt::internal::function<T> {
|
||||
|
||||
@@ -51,5 +51,4 @@ TEST(GrisuTest, Prettify) {
|
||||
EXPECT_EQ("12340000000.0", fmt::format("{}", 1234e7));
|
||||
EXPECT_EQ("12.34", fmt::format("{}", 1234e-2));
|
||||
EXPECT_EQ("0.001234", fmt::format("{}", 1234e-6));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user