Browse Source

don't use reference for inner loop result

Nicolas Cannasse 19 years ago
parent
commit
c30decbfc0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      std/List.hx

+ 3 - 3
std/List.hx

@@ -83,22 +83,22 @@ class List<T> {
 	}
 
 	public function remove( v : T ) : Bool {
+		var found = false;
 		var loop;
-		var found = { ref : false };
 		loop = function(h) {
 			return switch h {
 			case empty:
 				empty;
 			case cons(v2,h):
 				if( v2 == v ) {
-					found.ref = true;
+					found = true;
 					h;
 				} else
 					cons(v2,loop(h));
 			}
 		};
 		h = loop(h);
-		return found.ref;
+		return found;
 	}
 
 	public function length() {