mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
Merge pull request #1190 from georgthegreat/find-performance
Optimize std::string::find performance a bit
This commit is contained in:
commit
956998d37d
@ -456,7 +456,7 @@ public :
|
|||||||
<< " x=\"" << get<0>(map_point) + offset_x << "\""
|
<< " x=\"" << get<0>(map_point) + offset_x << "\""
|
||||||
<< " y=\"" << get<1>(map_point) + offset_y << "\""
|
<< " y=\"" << get<1>(map_point) + offset_y << "\""
|
||||||
<< ">";
|
<< ">";
|
||||||
if (s.find("\n") == std::string::npos)
|
if (s.find('\n') == std::string::npos)
|
||||||
{
|
{
|
||||||
m_stream << s;
|
m_stream << s;
|
||||||
}
|
}
|
||||||
|
@ -60,10 +60,10 @@ struct coordinate_cast<rational<T> >
|
|||||||
|
|
||||||
// Note: decimal comma is not (yet) supported, it does (and should) not
|
// Note: decimal comma is not (yet) supported, it does (and should) not
|
||||||
// occur in a WKT, where points are comma separated.
|
// occur in a WKT, where points are comma separated.
|
||||||
std::string::size_type p = source.find(".");
|
std::string::size_type p = source.find('.');
|
||||||
if (p == std::string::npos)
|
if (p == std::string::npos)
|
||||||
{
|
{
|
||||||
p = source.find("/");
|
p = source.find('/');
|
||||||
if (p == std::string::npos)
|
if (p == std::string::npos)
|
||||||
{
|
{
|
||||||
return rational<T>(atol(source.c_str()));
|
return rational<T>(atol(source.c_str()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user