瀏覽代碼

do not insert end() Iterators into the CacheSet even if requested

David Kalnischkies 16 年之前
父節點
當前提交
c45f2d1995
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      apt-pkg/cacheset.h

+ 6 - 0
apt-pkg/cacheset.h

@@ -61,6 +61,9 @@ public:									/*{{{*/
 	// 103. set::iterator is required to be modifiable, but this allows modification of keys
 	// 103. set::iterator is required to be modifiable, but this allows modification of keys
 	typedef typename APT::PackageSet::const_iterator iterator;
 	typedef typename APT::PackageSet::const_iterator iterator;
 
 
+	using std::set<pkgCache::PkgIterator>::insert;
+	inline void insert(pkgCache::PkgIterator const &P) { if (P.end() == false) std::set<pkgCache::PkgIterator>::insert(P); };
+
 	/** \brief returns all packages in the cache whose name matchs a given pattern
 	/** \brief returns all packages in the cache whose name matchs a given pattern
 
 
 	    A simple helper responsible for executing a regular expression on all
 	    A simple helper responsible for executing a regular expression on all
@@ -145,6 +148,9 @@ public:									/*{{{*/
 	// 103. set::iterator is required to be modifiable, but this allows modification of keys
 	// 103. set::iterator is required to be modifiable, but this allows modification of keys
 	typedef typename APT::VersionSet::const_iterator iterator;
 	typedef typename APT::VersionSet::const_iterator iterator;
 
 
+	using std::set<pkgCache::VerIterator>::insert;
+	inline void insert(pkgCache::VerIterator const &V) { if (V.end() == false) std::set<pkgCache::VerIterator>::insert(V); };
+
 	/** \brief specifies which version(s) will be returned if non is given */
 	/** \brief specifies which version(s) will be returned if non is given */
 	enum Version {
 	enum Version {
 		/** All versions */
 		/** All versions */