Explorar o código

added isEmpty.

Nicolas Cannasse %!s(int64=19) %!d(string=hai) anos
pai
achega
ae078b6ede
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      std/List.hx

+ 7 - 0
std/List.hx

@@ -75,6 +75,13 @@ class List<T> {
 		}
 	}
 
+	public function isEmpty() : Bool {
+		return switch h {
+		case empty : true;
+		default : false;
+		}
+	}
+
 	public function remove( v : T ) : Bool {
 		var loop;
 		var found = { ref : false };