[gitg/gnome-3-20] Only walk first tree level looking for .doap
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/gnome-3-20] Only walk first tree level looking for .doap
- Date: Thu, 25 Aug 2016 14:53:39 +0000 (UTC)
commit ab703d4f51d35637ce4b8a4bca8c360b7a956569
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Aug 14 10:26:09 2016 +0200
Only walk first tree level looking for .doap
libgitg/gitg-repository-list-box.vala | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala
index 1755787..81809b7 100644
--- a/libgitg/gitg-repository-list-box.vala
+++ b/libgitg/gitg-repository-list-box.vala
@@ -180,14 +180,18 @@ namespace Gitg
var tree = commit.get_tree();
Ggit.OId? entry_id = null;
- tree.walk(Ggit.TreeWalkMode.PRE, (root, entry) => {
- if (root == "" && entry.get_name() != null &&
entry.get_name().has_suffix(".doap"))
+
+ for (var i = 0; i < tree.size(); i++)
+ {
+ var entry = tree.get(i);
+ var name = entry.get_name();
+
+ if (name != null && name.has_suffix(".doap"))
{
entry_id = entry.get_id();
- return 1;
+ break;
}
- return 0;
- });
+ }
if (entry_id != null)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]