From 26d276459901fea7209203ec84403bb7934fb869 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 May 2005 07:59:17 +0000 Subject: * fix a bug QueueNextDiff --- apt-pkg/acquire-item.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 81636902e..fff55f7b5 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -287,13 +287,13 @@ bool pkgAcqIndexDiffs::QueueNextDiff() SHA1.AddFD(fd.Fd(), fd.Size()); string local_sha1 = string(SHA1.Result()); - // see if we have a patch for it, the patch list must be ordered + // remove all patches until the next matching patch is found + // this requires the Index file to be ordered for(vector::iterator I=available_patches.begin(); - I != available_patches.end(); I++) { - // if the patch does not fit, it's not interessting - if((*I).sha1 != local_sha1) - available_patches.erase(I); - } + (*I).sha1 == local_sha1 || I != available_patches.end(); + I++) + available_patches.erase(I); + // error checking and falling back if no patch was found if(available_patches.size() == 0) { -- cgit v1.2.3-70-g09d2