From 5243832dfd32a1704f729e7b6cdaa306ce814aac Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Fri, 8 Jun 2012 18:14:24 -0600 Subject: [PATCH] Use SourceRegistry.ref_source rather than iterate to find a source. --- backends/eds/lib/edsf-persona-store.vala | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala index 0c2c699..eca8c8e 100644 --- a/backends/eds/lib/edsf-persona-store.vala +++ b/backends/eds/lib/edsf-persona-store.vala @@ -2210,16 +2210,11 @@ public class Edsf.PersonaStore : Folks.PersonaStore * so we can assert that the source list is non-null. */ assert (this._source_registry != null); - GLib.List books = - ((!) this._source_registry).list_sources (SOURCE_EXTENSION_ADDRESS_BOOK); - - foreach (var s in books) + E.Source? needle = ((!) this._source_registry).ref_source(this.id); + if (needle != null && needle.has_extension (SOURCE_EXTENSION_ADDRESS_BOOK)) { - if (s.get_uid () == this.id) - { - /* We've found ourself. */ - return true; - } + /* We've found ourself. */ + return true; } return false; -- 2.7.4