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

Commit 1d4292bf authored by Jia He's avatar Jia He Committed by Dave Chinner
Browse files

libxfs: Optimize the loop for xfs_bitmap_empty



If there is any non zero bit in a long bitmap, it can jump out of the
loop and finish the function as soon as possible.

Signed-off-by: default avatarJia He <hejianet@gmail.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 16830985
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -32,13 +32,13 @@ int
xfs_bitmap_empty(uint *map, uint size)
{
	uint i;
	uint ret = 0;

	for (i = 0; i < size; i++) {
		ret |= map[i];
		if (map[i] != 0)
			return 0;
	}

	return (ret == 0);
	return 1;
}

/*