mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(show_tree): minor optimization.
This commit is contained in:
parent
b36adca2d1
commit
21fba120d0
@ -14,7 +14,7 @@
|
|||||||
Norbert Warmuth, 1997
|
Norbert Warmuth, 1997
|
||||||
Miguel de Icaza, 1996, 1999
|
Miguel de Icaza, 1996, 1999
|
||||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||||
Andrew Borodin <aborodin@vmail.ru>, 2013
|
Andrew Borodin <aborodin@vmail.ru>, 2013, 2014
|
||||||
|
|
||||||
This file is part of the Midnight Commander.
|
This file is part of the Midnight Commander.
|
||||||
|
|
||||||
@ -306,7 +306,6 @@ show_tree (WTree * tree)
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (current->prev && i < tree->topdiff)
|
while (current->prev && i < tree->topdiff)
|
||||||
{
|
{
|
||||||
|
|
||||||
current = current->prev;
|
current = current->prev;
|
||||||
|
|
||||||
if (current->sublevel < tree->selected_ptr->sublevel)
|
if (current->sublevel < tree->selected_ptr->sublevel)
|
||||||
@ -324,15 +323,11 @@ show_tree (WTree * tree)
|
|||||||
if (vfs_path_equal_len (current->name, tree->selected_ptr->name, j))
|
if (vfs_path_equal_len (current->name, tree->selected_ptr->name, j))
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
else
|
else if (current->sublevel == tree->selected_ptr->sublevel + 1)
|
||||||
{
|
{
|
||||||
if (current->sublevel == tree->selected_ptr->sublevel + 1
|
j = vfs_path_len (tree->selected_ptr->name);
|
||||||
&& vfs_path_len (tree->selected_ptr->name) > 1)
|
if (j > 1 && vfs_path_equal_len (current->name, tree->selected_ptr->name, j))
|
||||||
{
|
i++;
|
||||||
if (vfs_path_equal_len (current->name, tree->selected_ptr->name,
|
|
||||||
vfs_path_len (tree->selected_ptr->name)))
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tree->topdiff = i;
|
tree->topdiff = i;
|
||||||
|
Loading…
Reference in New Issue
Block a user