mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
util: bitmap: Tolerate NULL bitmaps in virBitmapEqual
After virBitmapEqual is able to compare NULL bitmaps few bits of code can be cleaned up. (cherry picked from commit 20448c2a72c3e420e6ad9d89f9f4302114bfef72) Signed-off-by: Ján Tomko <jtomko@redhat.com> Partial backport without the cleanup.
This commit is contained in:
parent
1021df2815
commit
0e1054a129
@ -504,6 +504,12 @@ bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
|
||||
virBitmapPtr tmp;
|
||||
size_t i;
|
||||
|
||||
if (!b1 && !b2)
|
||||
return true;
|
||||
|
||||
if (!b1 || !b2)
|
||||
return false;
|
||||
|
||||
if (b1->max_bit > b2->max_bit) {
|
||||
tmp = b1;
|
||||
b1 = b2;
|
||||
|
@ -84,8 +84,7 @@ virBitmapPtr virBitmapNewData(void *data, int len) ATTRIBUTE_NONNULL(1);
|
||||
int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2);
|
||||
|
||||
size_t virBitmapSize(virBitmapPtr bitmap)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user