From 103f68d7158fdab45cb3bd3c5b03e1ad75e332ae Mon Sep 17 00:00:00 2001 From: Gui Hecheng Date: Thu, 21 Aug 2014 10:56:52 +0800 Subject: btrfs-progs: cleanup duplicate assignment of variable leaf for btrfs-restore The value of variable leaf in while loop don't have to be set for every round. Just move it outside. Signed-off-by: Gui Hecheng Signed-off-by: David Sterba --- cmds-restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index 2f9b72d3..859deaf3 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -967,8 +967,9 @@ static int do_list_roots(struct btrfs_root *root) return -1; } + leaf = path->nodes[0]; + while (1) { - leaf = path->nodes[0]; slot = path->slots[0]; if (slot >= btrfs_header_nritems(leaf)) { ret = btrfs_next_leaf(root, path); -- cgit v1.2.3