[folks/648811-dummy-backend-rebase1] dummy: Use a map iterator instead of foreach
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks/648811-dummy-backend-rebase1] dummy: Use a map iterator instead of foreach
- Date: Thu, 7 Nov 2013 14:03:37 +0000 (UTC)
commit 5daa8ba17084b3f62008d110193c2206789a893e
Author: Philip Withnall <philip withnall collabora co uk>
Date: Thu Nov 7 14:00:14 2013 +0000
dummy: Use a map iterator instead of foreach
backends/dummy/lib/dummy-fat-persona.vala | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/backends/dummy/lib/dummy-fat-persona.vala b/backends/dummy/lib/dummy-fat-persona.vala
index a0da1e2..56d7e2c 100644
--- a/backends/dummy/lib/dummy-fat-persona.vala
+++ b/backends/dummy/lib/dummy-fat-persona.vala
@@ -711,14 +711,9 @@ public class FolksDummy.FatPersona : FolksDummy.Persona,
{
var output_multi_map = new HashMultiMap<S, T> ();
- foreach (var k in input_multi_map.get_keys ())
- {
- var values = input_multi_map.get (k);
- foreach (var v in values)
- {
- output_multi_map.set (k, v);
- }
- }
+ var iter = input_multi_map.map_iterator ();
+ while (iter.next () == true)
+ output_multi_map.set (iter.get_key (), iter.get_value ());
return output_multi_map;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]