summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2017-08-28 11:52:19 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2017-08-28 11:52:19 +0200
commitd4455c68ced391e4b773de371fe4799f6e097a99 (patch)
tree8300de8ab0c1e16e403bab0d9996fc770cdc043d /src
parent4cb532975fb9844997616c58931d874c90822369 (diff)
downloadgnome-contacts-d4455c68ced391e4b773de371fe4799f6e097a99.tar.gz
Cleanup: remove Contact.get_first_string
Diffstat (limited to 'src')
-rw-r--r--src/contacts-contact.vala17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index 07b6bdc..a8577ae 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -333,21 +333,14 @@ public class Contacts.Contact : GLib.Object {
return true;
}
- static string? get_first_string (Collection<string>? collection) {
- if (collection != null) {
- var i = collection.iterator();
- if (i.next())
- return i.get();
- }
- return null;
- }
-
private static bool has_pref (AbstractFieldDetails details) {
- if (get_first_string (details.get_parameter_values ("x-evolution-ui-slot")) == "1")
+ var evolution_pref = details.get_parameter_values ("x-evolution-ui-slot");
+ if (evolution_pref != null && Utils.get_first (evolution_pref) == "1")
return true;
- foreach (var param in details.parameters.get ("type")) {
+
+ foreach (var param in details.parameters["type"]) {
if (param.ascii_casecmp ("PREF") == 0)
- return true;
+ return true;
}
return false;
}