소스 검색

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 ) {