metamodel: use HashSets instead of Arrays
authorJean Privat <jean@pryen.org>
Fri, 16 Jul 2010 03:41:47 +0000 (23:41 -0400)
committerJean Privat <jean@pryen.org>
Fri, 16 Jul 2010 03:41:47 +0000 (23:41 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/icode/icode_base.nit
src/metamodel/abstractmetamodel.nit

index 6afa03d..d795c55 100644 (file)
@@ -56,13 +56,13 @@ class IRoutine
        readable writable var _closure_decls: nullable Sequence[IClosureDecl] = null
 
        # The local variables (excluding params and result)
-       readable var _registers: Set[IRegister] = new ArraySet[IRegister]
+       readable var _registers: Set[IRegister] = new HashSet[IRegister]
 
        # The result of the routine
        readable var _result: nullable IRegister
 
        # The local escapes marks of the routine
-       readable var _escape_marks: Set[IEscapeMark] = new ArraySet[IEscapeMark]
+       readable var _escape_marks: Set[IEscapeMark] = new HashSet[IEscapeMark]
 
        # The sequence of icode
        readable var _body: ISeq = new ISeq
index 9d93d37..cc321ac 100644 (file)
@@ -54,7 +54,6 @@ class MMContext
        fun add_local_class(c: MMLocalClass, sup: Array[MMLocalClass])
        do
                var csup = new Array[MMLocalClass]
-               var csups = new Array[String]
                for s in sup do
                        if s isa MMConcreteClass then
                                csup.add(s)
@@ -128,10 +127,10 @@ class MMModule
        readable var _mhe: nullable PartialOrderElement[MMModule]
 
        # All global classes of the module (defined and imported)
-       readable var _global_classes: Array[MMGlobalClass] = new Array[MMGlobalClass]
+       readable var _global_classes: Set[MMGlobalClass] = new HashSet[MMGlobalClass]
 
        # All local classes of the module (defined and imported)
-       readable var _local_classes: Array[MMLocalClass] = new Array[MMLocalClass]
+       readable var _local_classes: Set[MMLocalClass] = new HashSet[MMLocalClass]
 
        # Class specialization hierarchy of the module.
        readable var _class_specialization_hierarchy: PartialOrder[MMLocalClass] = new PartialOrder[MMLocalClass]