diff src/luan/modules/TableLuan.java @ 1335:e0cf0d108a77

major cleanup
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 14 Feb 2019 03:10:45 -0700
parents c88b486a9511
children 225808b90cee
line wrap: on
line diff
--- a/src/luan/modules/TableLuan.java	Tue Feb 12 22:53:57 2019 -0700
+++ b/src/luan/modules/TableLuan.java	Thu Feb 14 03:10:45 2019 -0700
@@ -9,7 +9,6 @@
 import luan.LuanFunction;
 import luan.LuanException;
 import luan.LuanRuntimeException;
-import luan.LuanMethod;
 
 
 public final class TableLuan {
@@ -47,7 +46,7 @@
 		public boolean isLessThan(Object o1,Object o2);
 	}
 
-	public static void sort(final Luan luan,LuanTable list,final LuanFunction comp) throws LuanException {
+	public static void sort(LuanTable list,final LuanFunction comp) throws LuanException {
 		if( list.getMetatable() != null )
 			throw new LuanException("can't sort a table with a metatable");
 		final LessThan lt;
@@ -55,7 +54,7 @@
 			lt = new LessThan() {
 				public boolean isLessThan(Object o1,Object o2) {
 					try {
-						return luan.isLessThan(o1,o2);
+						return Luan.isLessThan(o1,o2);
 					} catch(LuanException e) {
 						throw new LuanRuntimeException(e);
 					}
@@ -65,7 +64,7 @@
 			lt = new LessThan() {
 				public boolean isLessThan(Object o1,Object o2) {
 					try {
-						return Luan.checkBoolean(Luan.first(comp.call(luan,new Object[]{o1,o2})));
+						return Luan.checkBoolean(Luan.first(comp.call(o1,o2)));
 					} catch(LuanException e) {
 						throw new LuanRuntimeException(e);
 					}
@@ -89,7 +88,7 @@
 		return tbl;
 	}
 
-	@LuanMethod public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) throws LuanException {
+	public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) throws LuanException {
 		int from = iFrom!=null ? iFrom : 1;
 		int to;
 		if( iTo != null ) {
@@ -105,7 +104,7 @@
 		return list.toArray();
 	}
 
-	public static LuanTable copy(Luan luan,LuanTable list,Integer from,Integer to) {
+	public static LuanTable copy(LuanTable list,Integer from,Integer to) {
 		if( from == null )
 			return new LuanTable(list);
 		if( to == null )