use std::unordered_map in non-perf critical code
This commit is contained in:
parent
75248e3376
commit
03429f9bcb
2 changed files with 5 additions and 4 deletions
|
@ -29,10 +29,11 @@
|
|||
#include <mapnik/noncopyable.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/interprocess/interprocess_fwd.hpp>
|
||||
|
||||
namespace boost { namespace interprocess { class mapped_region; } }
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
@ -44,7 +45,7 @@ class MAPNIK_DECL mapped_memory_cache :
|
|||
private mapnik::noncopyable
|
||||
{
|
||||
friend class CreateStatic<mapped_memory_cache>;
|
||||
boost::unordered_map<std::string,mapped_region_ptr> cache_;
|
||||
std::unordered_map<std::string,mapped_region_ptr> cache_;
|
||||
public:
|
||||
bool insert(std::string const& key, mapped_region_ptr);
|
||||
boost::optional<mapped_region_ptr> find(std::string const& key, bool update_cache = false);
|
||||
|
|
|
@ -56,7 +56,7 @@ boost::optional<mapped_region_ptr> mapped_memory_cache::find(std::string const&
|
|||
#ifdef MAPNIK_THREADSAFE
|
||||
mapnik::scoped_lock lock(mutex_);
|
||||
#endif
|
||||
using iterator_type = boost::unordered_map<std::string, mapped_region_ptr>::const_iterator;
|
||||
using iterator_type = std::unordered_map<std::string, mapped_region_ptr>::const_iterator;
|
||||
boost::optional<mapped_region_ptr> result;
|
||||
iterator_type itr = cache_.find(uri);
|
||||
if (itr != cache_.end())
|
||||
|
|
Loading…
Add table
Reference in a new issue