Implement ExtentLess correctly
If two extents start on the same block but have different number of
blocks, current impl of ExtentLess will consider them equal.
Test: th
Change-Id: Ief147f9d0a91b3dcd7f8ccc690f3aea972cbeabb
diff --git a/payload_generator/extent_ranges.h b/payload_generator/extent_ranges.h
index 4894831..8e3e261 100644
--- a/payload_generator/extent_ranges.h
+++ b/payload_generator/extent_ranges.h
@@ -37,6 +37,9 @@
struct ExtentLess {
bool operator()(const Extent& x, const Extent& y) const {
+ if (x.start_block() == y.start_block()) {
+ return x.num_blocks() < y.num_blocks();
+ }
return x.start_block() < y.start_block();
}
};