compile: remove ClassSorter, use sort with block instead
authorJean-Sebastien Gelinas <calestar@gmail.com>
Tue, 8 Sep 2009 15:28:56 +0000 (11:28 -0400)
committerJean Privat <jean@pryen.org>
Fri, 11 Sep 2009 17:51:56 +0000 (13:51 -0400)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiling/table_computation.nit

index 0103fd5..cad65e6 100644 (file)
@@ -155,7 +155,6 @@ redef class Program
        # Do the complete global analysis
        private fun do_global_table_analysis
        do
-               #print "Do the complete global analysis"
                var smallest_classes = new Array[MMLocalClass]
                var global_properties = new HashSet[MMGlobalProperty]
                var ctab = new Array[TableElt]
@@ -175,7 +174,7 @@ redef class Program
                        c.compute_super_classes
                        classes.add(c)
                end
-               (new ClassSorter).sort(classes)
+               classes.sort !cmp(x,y) = x.total_order_compare(y)
 
                for c in classes do
                        # Finish processing the class (if invisible)
@@ -561,13 +560,3 @@ class TableEltVftPointer
 special TableElt
        redef fun is_related_to(c) do return true
 end
-
-###############################################################################
-
-# Used to sort local class in a deterministic total order
-# The total order superset the class refinement and the class specialisation relations
-class ClassSorter
-special AbstractSorter[MMLocalClass]
-       redef fun compare(a, b) do return a.total_order_compare(b)
-       init do end
-end