Browse Source

added isEmpty.

Nicolas Cannasse 19 years ago
parent
commit
ae078b6ede
1 changed files with 7 additions and 0 deletions
  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 };