replace boost::trim with faster internal trim - refs #1633
This commit is contained in:
parent
58d53dbe2f
commit
626e0056fd
2 changed files with 8 additions and 4 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
|
#include <mapnik/util/trim.hpp>
|
||||||
|
|
||||||
#include "dbfile.hpp"
|
#include "dbfile.hpp"
|
||||||
|
|
||||||
|
@ -138,7 +139,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f)
|
||||||
{
|
{
|
||||||
// FIXME - avoid constructing std::string on stack
|
// FIXME - avoid constructing std::string on stack
|
||||||
std::string str(record_+fields_[col].offset_,fields_[col].length_);
|
std::string str(record_+fields_[col].offset_,fields_[col].length_);
|
||||||
boost::trim(str);
|
mapnik::util::trim(str);
|
||||||
f.put(name,tr.transcode(str.c_str()));
|
f.put(name,tr.transcode(str.c_str()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +207,9 @@ void dbf_file::read_header()
|
||||||
field_descriptor desc;
|
field_descriptor desc;
|
||||||
desc.index_=i;
|
desc.index_=i;
|
||||||
file_.read(name,10);
|
file_.read(name,10);
|
||||||
desc.name_=boost::trim_left_copy(std::string(name));
|
desc.name_=name;
|
||||||
|
// TODO - when is this trim needed?
|
||||||
|
mapnik::util::trim(desc.name_);
|
||||||
skip(1);
|
skip(1);
|
||||||
desc.type_=file_.get();
|
desc.type_=file_.get();
|
||||||
skip(4);
|
skip(4);
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <mapnik/util/geometry_to_ds_type.hpp>
|
#include <mapnik/util/geometry_to_ds_type.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
|
#include <mapnik/util/trim.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -429,8 +430,8 @@ void sqlite_datasource::parse_attachdb(std::string const& attachdb) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Break out the dbname and the filename
|
// Break out the dbname and the filename
|
||||||
std::string dbname = boost::trim_copy(spec.substr(0, atpos));
|
std::string dbname = mapnik::util::trim_copy(spec.substr(0, atpos));
|
||||||
std::string filename = boost::trim_copy(spec.substr(atpos + 1));
|
std::string filename = mapnik::util::trim_copy(spec.substr(atpos + 1));
|
||||||
|
|
||||||
// Normalize the filename and make it relative to dataset_name_
|
// Normalize the filename and make it relative to dataset_name_
|
||||||
if (filename.compare(":memory:") != 0)
|
if (filename.compare(":memory:") != 0)
|
||||||
|
|
Loading…
Reference in a new issue