- avoid unnecessary jumping in repomd handler, it's slow enough as is :-/
authorpmatilai <pmatilai>
Thu, 23 Mar 2006 21:45:27 +0000 (21:45 +0000)
committerpmatilai <pmatilai>
Thu, 23 Mar 2006 21:45:27 +0000 (21:45 +0000)
apt-pkg/rpm/rpmhandler.cc

index d06b0bb..473f397 100644 (file)
@@ -943,8 +943,12 @@ bool RPMRepomdHandler::Skip()
 
 bool RPMRepomdHandler::Jump(unsigned int Offset)
 {
-   NodeP = Root->children;
-   iOffset = 0;
+   if (Offset == iOffset) {
+      return true;
+   } else if (Offset > iOffset) {
+      NodeP = Root->children;
+      iOffset = 0;
+   }
 // cout << __PRETTY_FUNCTION__ << " Offset: " << Offset << endl;
    while (NodeP && (iOffset < Offset) ) {
       if ((NodeP->type == XML_ELEMENT_NODE) &&