mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-27 20:09:23 +00:00
files: optimization to avoid o(n^2) iteration
This commit is contained in:
parent
827a5e9110
commit
04249d8fbe
|
@ -167,20 +167,25 @@ public class TreeStore : Gtk.TreeStore
|
|||
});
|
||||
} catch (Error e) { }
|
||||
|
||||
if (items == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
items.reverse();
|
||||
|
||||
unowned List<Item?>? i = items;
|
||||
var paths = new HashTable<string, Gtk.TreePath>(str_hash, str_equal);
|
||||
var i = 0;
|
||||
d_update_id = Idle.add(() => {
|
||||
Item? item = items.nth_data(i);
|
||||
i++;
|
||||
|
||||
if (item == null)
|
||||
if (i == null)
|
||||
{
|
||||
d_update_id = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
Item item = i.data;
|
||||
i = i.next;
|
||||
|
||||
var root = item.root;
|
||||
var entry = item.entry;
|
||||
var isdir = entry.get_file_mode() == Ggit.FileMode.TREE;
|
||||
|
|
Loading…
Reference in a new issue