[libcxx-commits] [PATCH] D71214: [libc++] reduce <complex> parsing time
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 19 13:11:36 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc3478eff7a65: [libc++] reduce <complex> parsing time (authored by ldionne).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71214/new/
https://reviews.llvm.org/D71214
Files:
libcxx/include/complex
Index: libcxx/include/complex
===================================================================
--- libcxx/include/complex
+++ libcxx/include/complex
@@ -243,7 +243,7 @@
#include <type_traits>
#include <stdexcept>
#include <cmath>
-#include <sstream>
+#include <iosfwd>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -1406,10 +1406,10 @@
__x = complex<_Tp>(__r, __i);
}
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
}
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
}
else if (__c == _CharT(')'))
{
@@ -1417,10 +1417,10 @@
__x = complex<_Tp>(__r, _Tp(0));
}
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
}
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
}
else
{
@@ -1429,11 +1429,11 @@
if (!__is.fail())
__x = complex<_Tp>(__r, _Tp(0));
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
}
}
else
- __is.setstate(ios_base::failbit);
+ __is.setstate(__is.failbit);
return __is;
}
@@ -1441,12 +1441,7 @@
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
{
- basic_ostringstream<_CharT, _Traits> __s;
- __s.flags(__os.flags());
- __s.imbue(__os.getloc());
- __s.precision(__os.precision());
- __s << '(' << __x.real() << ',' << __x.imag() << ')';
- return __os << __s.str();
+ return __os << '(' << __x.real() << ',' << __x.imag() << ')';
}
#if _LIBCPP_STD_VER > 11
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71214.245498.patch
Type: text/x-patch
Size: 2065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200219/bd94e93b/attachment.bin>
More information about the libcxx-commits
mailing list