Imported Upstream version 17.1.3
[platform/upstream/libzypp.git] / zypp / media / MediaBlockList.cc
index e7808e1..57ccd58 100644 (file)
@@ -14,7 +14,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <expat.h>
 
 #include <vector>
 #include <iostream>
@@ -44,9 +43,7 @@ size_t
 MediaBlockList::addBlock(off_t off, size_t size)
 {
   haveblocks = true;
-  blocks.push_back(MediaBlock());
-  blocks.back().off = off;
-  blocks.back().size = size;
+  blocks.push_back(MediaBlock( off, size ));
   return blocks.size() - 1;
 }
 
@@ -300,7 +297,7 @@ MediaBlockList::reuseBlocks(FILE *wfp, string filename)
       memset(ht, 0, (hm + 1) * sizeof(unsigned int));
       for (unsigned int i = 0; i < rsums.size(); i++)
        {
-         if (blocks[i].size != blksize && (i != nblks - 1 || rsumpad == blksize))
+         if (blocks[i].size != blksize && (i != nblks - 1 || rsumpad != blksize))
            continue;
          unsigned int r = rsums[i];
          unsigned int h = r & hm;
@@ -350,7 +347,7 @@ MediaBlockList::reuseBlocks(FILE *wfp, string filename)
                }
              int oc = buf[i];
              buf[i] = c;
-             a += c - oc; 
+             a += c - oc;
              if (bshift)
                b += a - (oc << bshift);
              else
@@ -370,7 +367,7 @@ MediaBlockList::reuseBlocks(FILE *wfp, string filename)
                r = ((unsigned int)a & 255) << 16 | ((unsigned int)b & 65535);
              else
                r = ((unsigned int)a & 65535) << 16 | ((unsigned int)b & 65535);
-             unsigned int h = r & hm; 
+             unsigned int h = r & hm;
              unsigned int hh = 7;
              for (; ht[h]; h = (h + hh++) & hm)
                {
@@ -466,7 +463,7 @@ MediaBlockList::reuseBlocks(FILE *wfp, string filename)
   std::vector<MediaBlock> nblocks;
   std::vector<unsigned char> nchksums;
   std::vector<unsigned int> nrsums;
-  
+
   for (size_t blkno = 0; blkno < blocks.size(); ++blkno)
     {
       if (!found[blkno])