java-gobject-introspection r136 - trunk/src/org/gnome/gir/compiler
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: java-gobject-introspection r136 - trunk/src/org/gnome/gir/compiler
- Date: Fri, 28 Nov 2008 00:48:29 +0000 (UTC)
Author: walters
Date: Fri Nov 28 00:48:29 2008
New Revision: 136
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=136&view=rev
Log:
Uniquify interfaces more conservatively
Difficult to uniquify using prereqs correctly; just at least
ensure we don't have duplicates.
Modified:
trunk/src/org/gnome/gir/compiler/TypeMap.java
Modified: trunk/src/org/gnome/gir/compiler/TypeMap.java
==============================================================================
--- trunk/src/org/gnome/gir/compiler/TypeMap.java (original)
+++ trunk/src/org/gnome/gir/compiler/TypeMap.java Fri Nov 28 00:48:29 2008
@@ -4,7 +4,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
-import java.util.Iterator;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -227,24 +227,7 @@
}
public static List<InterfaceInfo> getUniqueInterfaces(List<InterfaceInfo> ifaces) {
- boolean hit = true;
- ifaces = new ArrayList<InterfaceInfo>(ifaces);
- while (hit) {
- hit = false;
- for (Iterator<InterfaceInfo> it = ifaces.iterator(); it.hasNext();) {
- InterfaceInfo possible = it.next();
- for (InterfaceInfo iface : ifaces) {
- if (iface == possible)
- continue;
- if (TypeMap.isAssignableFrom(possible, iface)) {
- it.remove();
- hit = true;
- break;
- }
- }
- }
- }
- return ifaces;
+ return new ArrayList<InterfaceInfo>(new HashSet<InterfaceInfo>(ifaces));
}
public static List<InterfaceInfo> getUniqueInterfaces(ObjectInfo obj) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]