use std::unordered_map in non-perf critical code

This commit is contained in:
Dane Springmeyer 2014-08-04 13:59:02 -07:00
parent 75248e3376
commit 03429f9bcb
2 changed files with 5 additions and 4 deletions

View file

@ -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);

View file

@ -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())