[vala/switch-to-gir-gio: 26/35] girparser: Use an HashSet for merged symbols.



commit d368e85d86c3d826b477b9b229a7f0d183e23ed9
Author: Luca Bruno <lucabru src gnome org>
Date:   Fri Dec 24 19:36:05 2010 +0100

    girparser: Use an HashSet for merged symbols.

 vala/valagirparser.vala |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f7ddaec..5e3d935 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -857,7 +857,7 @@ public class Vala.GirParser : CodeVisitor {
 		return null;
 	}
 
-	void merge (SymbolInfo info, ArrayList<SymbolInfo> colliding, ArrayList<SymbolInfo> merged) {
+	void merge (SymbolInfo info, ArrayList<SymbolInfo> colliding, HashSet<SymbolInfo> merged) {
 		if (info.symbol is Struct) {
 			var gtype_struct_for = info.girdata["glib:is-gtype-struct-for"];
 			if (gtype_struct_for != null && current_symbols_info.contains (gtype_struct_for)) {
@@ -1038,9 +1038,8 @@ public class Vala.GirParser : CodeVisitor {
 	}
 
 	void merge_add_process (Symbol container) {
-		var merged = new ArrayList<SymbolInfo> ();
-		foreach (var name in current_symbols_info.get_keys ()) {
-			var colliding = current_symbols_info[name];
+		var merged = new HashSet<SymbolInfo> ();
+		foreach (var colliding in current_symbols_info.get_values ()) {
 			foreach (var info in colliding) {
 				merge (info, colliding, merged);
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]