[gitg] Use Gee.LinkedList for remote refs
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Use Gee.LinkedList for remote refs
- Date: Tue, 16 Oct 2012 19:10:27 +0000 (UTC)
commit 6aa2958ee8550429b88a9b7f0d7c697b1e387caf
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Tue Oct 16 21:10:10 2012 +0200
Use Gee.LinkedList for remote refs
It's easier to use the Gee.LinkedList class since it's properly reffed
plugins/history/gitg-history-navigation.vala | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/history/gitg-history-navigation.vala b/plugins/history/gitg-history-navigation.vala
index b3c927c..45ff80c 100644
--- a/plugins/history/gitg-history-navigation.vala
+++ b/plugins/history/gitg-history-navigation.vala
@@ -46,10 +46,10 @@ namespace GitgHistory
List<Gitg.Ref> branches = new List<Gitg.Ref>();
List<Gitg.Ref> tags = new List<Gitg.Ref>();
- HashTable<string, List<Gitg.Ref>> remotes;
+ HashTable<string, Gee.LinkedList<Gitg.Ref>> remotes;
List<string> remotenames = new List<string>();
- remotes = new HashTable<string, List<Gitg.Ref>>(str_hash, str_equal);
+ remotes = new HashTable<string, Gee.LinkedList<Gitg.Ref>>(str_hash, str_equal);
d_all = new List<Gitg.Ref>();
try
@@ -74,21 +74,21 @@ namespace GitgHistory
}
else if (r.parsed_name.rtype == Gitg.RefType.REMOTE)
{
- unowned List<Gitg.Ref> lst;
+ Gee.LinkedList<Gitg.Ref> lst;
string rname = r.parsed_name.remote_name;
if (!remotes.lookup_extended(rname, null, out lst))
{
- List<Gitg.Ref> nlst = new List<Gitg.Ref>();
- nlst.prepend(r);
+ Gee.LinkedList<Gitg.Ref> nlst = new Gee.LinkedList<Gitg.Ref>();
+ nlst.insert(0, r);
- remotes.insert(rname, (owned)nlst);
+ remotes.insert(rname, nlst);
remotenames.insert_sorted(rname, (a, b) => a.ascii_casecmp(b));
}
else
{
- lst.prepend(r);
+ lst.insert(0, r);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]