Always use Account.hash(equals)_func for HashMap+ArrayList

This commit is contained in:
fiaxh 2018-11-24 21:00:44 +01:00
parent c44489214e
commit 22340cb88e
3 changed files with 3 additions and 3 deletions

View file

@ -268,7 +268,7 @@ public class Database : Qlite.Database {
} }
public ArrayList<Account> get_accounts() { public ArrayList<Account> get_accounts() {
ArrayList<Account> ret = new ArrayList<Account>(); ArrayList<Account> ret = new ArrayList<Account>(Account.equals_func);
foreach(Row row in account.select()) { foreach(Row row in account.select()) {
Account account = new Account.from_row(this, row); Account account = new Account.from_row(this, row);
ret.add(account); ret.add(account);

View file

@ -6,7 +6,7 @@ using Xmpp;
namespace Dino { namespace Dino {
public class ModuleManager { public class ModuleManager {
private HashMap<Account, ArrayList<XmppStreamModule>> module_map = new HashMap<Account, ArrayList<XmppStreamModule>>(); private HashMap<Account, ArrayList<XmppStreamModule>> module_map = new HashMap<Account, ArrayList<XmppStreamModule>>(Account.hash_func, Account.equals_func);
private EntityCapabilitiesStorage entity_capabilities_storage; private EntityCapabilitiesStorage entity_capabilities_storage;

View file

@ -11,7 +11,7 @@ protected class ConferenceList : FilterableList {
public signal void conversation_selected(Conversation? conversation); public signal void conversation_selected(Conversation? conversation);
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private HashMap<Account, Gee.List<Xep.Bookmarks.Conference>> lists = new HashMap<Account, Gee.List<Xep.Bookmarks.Conference>>(); private HashMap<Account, Gee.List<Xep.Bookmarks.Conference>> lists = new HashMap<Account, Gee.List<Xep.Bookmarks.Conference>>(Account.hash_func, Account.equals_func);
public ConferenceList(StreamInteractor stream_interactor) { public ConferenceList(StreamInteractor stream_interactor) {
this.stream_interactor = stream_interactor; this.stream_interactor = stream_interactor;