Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df6b5c3 authored by Tao Bao's avatar Tao Bao Committed by Gerrit Code Review
Browse files

Merge "sparse_img.py: Don't write empty map groups."

parents c94a705f a8978120
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -221,8 +221,13 @@ class SparseImage(object):
          nonzero_blocks.append(b)
          nonzero_blocks.append(b+1)

    assert zero_blocks or nonzero_blocks or clobbered_blocks

    if zero_blocks:
      out["__ZERO"] = rangelib.RangeSet(data=zero_blocks)
    if nonzero_blocks:
      out["__NONZERO"] = rangelib.RangeSet(data=nonzero_blocks)
    if clobbered_blocks:
      out["__COPY"] = clobbered_blocks

  def ResetFileMap(self):