From 1ad268a6ee75a34417364a967baa181f58d67768 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 27 Jun 2017 21:52:42 +0200 Subject: [PATCH] device, utils: remove unnecessary helper array_list_to_list() --- src/mconnect/device.vala | 4 ++-- src/mconnect/utils.vala | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/mconnect/device.vala b/src/mconnect/device.vala index dcd1e44..5337af5 100644 --- a/src/mconnect/device.vala +++ b/src/mconnect/device.vala @@ -206,9 +206,9 @@ class Device : Object { cache.set_boolean(name, "paired", this.is_paired); cache.set_string(name, "certificate", this.certificate); cache.set_string_list(name, "outgoing_capabilities", - array_list_to_list(this.outgoing_capabilities)); + this.outgoing_capabilities.to_array()); cache.set_string_list(name, "incoming_capabilities", - array_list_to_list(this.incoming_capabilities)); + this.incoming_capabilities.to_array()); } private async void greet() { diff --git a/src/mconnect/utils.vala b/src/mconnect/utils.vala index 2f68d54..b3d14c5 100644 --- a/src/mconnect/utils.vala +++ b/src/mconnect/utils.vala @@ -19,22 +19,6 @@ */ using Posix; -/** - * @array_list_to_list: - * @al: Gee.ArrayList - * - * Convert Gee.ArrayList to T[] - */ -T[] array_list_to_list(Gee.ArrayList al) { - T[] out_list = new T[al.size]; - int i = 0; - foreach(var v in al) { - out_list[i] = v; - i++; - } - return out_list; -} - namespace DebugLog{ public bool Verbose = false; }