diff --git a/include/DOM/Simple/DocumentImpl.hpp b/include/DOM/Simple/DocumentImpl.hpp index 6cd58718..f2db7d64 100644 --- a/include/DOM/Simple/DocumentImpl.hpp +++ b/include/DOM/Simple/DocumentImpl.hpp @@ -17,8 +17,8 @@ #include #include -#include #include +#include namespace Arabica { @@ -506,11 +506,7 @@ class DocumentImpl : public DOM::Document_impl, stringT const* stringPool(const stringT& str) const { - typename std::list::const_iterator i = std::find(stringPool_.begin(), stringPool_.end(), str); - if(i != stringPool_.end()) - return &(*i); - stringPool_.push_back(str); - return &(stringPool_.back()); + return &(*stringPool_.insert(str).first); } // stringPool const stringT& empty_string() const { return empty_; } @@ -537,7 +533,7 @@ class DocumentImpl : public DOM::Document_impl, mutable std::set orphans_; std::set idNodes_; - mutable std::list stringPool_; + mutable boost::unordered_set stringPool_; const stringT empty_; }; // class DocumentImpl