summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index dfe5707e1..eb8dee5e3 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -75,6 +75,12 @@ template<typename Str, typename Itr> class pkgCache::Iterator :
inline bool IsGood() const { return S && Owner && ! end();};
inline unsigned long Index() const {return S - OwnerPointer();};
+ void ReOwn(pkgCache &newOwner, void const * const oldMap, void const * const newMap) {
+ if (S == 0)
+ return;
+ S += (Str*)(newMap) - (Str*)(oldMap);
+ }
+
// Constructors - look out for the variable assigning
inline Iterator() : S(0), Owner(0) {};
inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {};