浏览代码

use property for length.

Nicolas Cannasse 19 年之前
父节点
当前提交
01426f0593
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      std/List.hx

+ 2 - 1
std/List.hx

@@ -56,6 +56,7 @@ class ListIter<T> implements Iterator<T> {
 class List<T> {
 
 	private var h : Cell<T>;
+	public property length(getLength,null) : Int;
 
 	public function new() {
 		h = empty;
@@ -110,7 +111,7 @@ class List<T> {
 		return found;
 	}
 
-	public function length() {
+	public function getLength() {
 		var c = 0;
 		var h = this.h;
 		while( true ) {