aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 07:04:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 07:04:48 +0000
commit01f3f805648f436ae8ee3526375252bc496129e7 (patch)
tree66b1cabdf1bac3cc6e34cd5ce93a60cf6e39d871
parent9ed3a2a493ff4cb21e63d085bad908d994fbef3d (diff)
downloadpaludis-01f3f805648f436ae8ee3526375252bc496129e7.tar.gz
paludis-01f3f805648f436ae8ee3526375252bc496129e7.tar.xz
Use a deque in various places where it makes sense.
-rw-r--r--paludis/composite_dep_atom.hh6
-rw-r--r--paludis/dep_list.cc7
-rw-r--r--paludis/dep_list.hh1
-rw-r--r--paludis/portage_repository.cc13
4 files changed, 15 insertions, 12 deletions
diff --git a/paludis/composite_dep_atom.hh b/paludis/composite_dep_atom.hh
index e4c20cc..19d9c79 100644
--- a/paludis/composite_dep_atom.hh
+++ b/paludis/composite_dep_atom.hh
@@ -22,7 +22,7 @@
#include <paludis/dep_atom.hh>
#include <paludis/counted_ptr.hh>
-#include <list>
+#include <deque>
/** \file
* Declarations for the CompositeDepAtom class.
@@ -42,7 +42,7 @@ namespace paludis
public virtual Composite<DepAtom, CompositeDepAtom>
{
private:
- std::list<DepAtom::ConstPointer> _children;
+ std::deque<DepAtom::ConstPointer> _children;
protected:
/**
@@ -59,7 +59,7 @@ namespace paludis
/**
* Iterator for iterating over our children.
*/
- typedef std::list<DepAtom::ConstPointer>::const_iterator Iterator;
+ typedef std::deque<DepAtom::ConstPointer>::const_iterator Iterator;
/**
* Iterator to the start of our children.
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 8fe7cac..17e0a15 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -34,6 +34,7 @@
#include <algorithm>
#include <functional>
+#include <deque>
using namespace paludis;
@@ -239,7 +240,7 @@ DepList::visit(const PackageDepAtom * const p)
_implementation->pending_list.begin(), _implementation->pending_list.end(),
DepListEntryMatcher(_implementation->environment->package_database().raw_pointer(), *p)))))
{
- std::list<std::string> entries;
+ std::deque<std::string> entries;
entries.push_front(stringify(*p));
std::transform(_implementation->pending_list.begin(), ++i,
std::back_inserter(entries), &stringify<DepListEntry>);
@@ -376,7 +377,7 @@ DepList::visit(const AnyDepAtom * const a)
* we handle this by keeping a list of 'viable children'.
*/
- std::list<DepAtom::ConstPointer> viable_children;
+ std::deque<DepAtom::ConstPointer> viable_children;
std::copy(a->begin(), a->end(), filter_inserter(
std::back_inserter(viable_children), IsViable(*_implementation)));
@@ -403,7 +404,7 @@ DepList::visit(const AnyDepAtom * const a)
}
/* try to merge each of our viable children in turn. */
- std::list<std::string> errors;
+ std::deque<std::string> errors;
for (CompositeDepAtom::Iterator i(viable_children.begin()), i_end(viable_children.end()) ;
i != i_end ; ++i)
{
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index 9b96a37..9186672 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -32,6 +32,7 @@
#include <paludis/version_spec.hh>
#include <ostream>
#include <list>
+#include <deque>
namespace paludis
{
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index f13df72..3a4a46d 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -37,6 +37,7 @@
#include <functional>
#include <algorithm>
#include <vector>
+#include <deque>
using namespace paludis;
@@ -79,7 +80,7 @@ namespace paludis
mutable std::map<std::pair<QualifiedPackageName, VersionSpec>, VersionMetadata::Pointer> metadata;
/// Repository mask.
- mutable std::map<QualifiedPackageName, std::vector<PackageDepAtom::ConstPointer> > repo_mask;
+ mutable std::map<QualifiedPackageName, std::deque<PackageDepAtom::ConstPointer> > repo_mask;
/// Have repository mask?
mutable bool has_repo_mask;
@@ -150,9 +151,9 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
Context context_local("When reading make.defaults file:");
KeyValueConfigFile make_defaults_f(f / "make.defaults");
- std::vector<std::string> uses;
+ std::deque<std::string> uses;
tokeniser.tokenise(make_defaults_f.get("USE"), std::back_inserter(uses));
- for (std::vector<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
+ for (std::deque<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
u != u_end ; ++u)
{
if ('-' == u->at(0))
@@ -183,7 +184,7 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
for (LineConfigFile::Iterator line(virtuals_f.begin()), line_end(virtuals_f.end()) ;
line != line_end ; ++line)
{
- std::vector<std::string> tokens;
+ std::deque<std::string> tokens;
tokeniser.tokenise(*line, std::back_inserter(tokens));
if (tokens.size() < 2)
continue;
@@ -494,13 +495,13 @@ PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
_implementation->has_repo_mask = true;
}
- std::map<QualifiedPackageName, std::vector<PackageDepAtom::ConstPointer> >::const_iterator r(
+ std::map<QualifiedPackageName, std::deque<PackageDepAtom::ConstPointer> >::const_iterator r(
_implementation->repo_mask.find(QualifiedPackageName(c, p)));
if (_implementation->repo_mask.end() == r)
return false;
else
{
- for (IndirectIterator<std::vector<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
+ for (IndirectIterator<std::deque<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
{
if (k->package() != QualifiedPackageName(c, p))