Browse Source

Don't use field for ListIterator next var, unless we're on js with analyzer turned off, because all other targets (or js with analyzer) inline "next" with var properly

Dan Korostelev 9 years ago
parent
commit
ab43455629
1 changed files with 3 additions and 3 deletions
  1. 3 3
      std/List.hx

+ 3 - 3
std/List.hx

@@ -262,11 +262,11 @@ private class ListNode<T> {
 
 
 private class ListIterator<T> {
 private class ListIterator<T> {
 	var head:ListNode<T>;
 	var head:ListNode<T>;
-	var val:Dynamic;
+	#if (js && !analyzer) var val:Dynamic; #end
 
 
 	public inline function new(head:ListNode<T>) {
 	public inline function new(head:ListNode<T>) {
 		this.head = head;
 		this.head = head;
-		this.val = null;
+		#if (js && !analyzer) this.val = null; #end
 	}
 	}
 
 
 	public inline function hasNext():Bool {
 	public inline function hasNext():Bool {
@@ -274,7 +274,7 @@ private class ListIterator<T> {
 	}
 	}
 
 
 	public inline function next():T {
 	public inline function next():T {
-		val = head.item;
+		#if (!js || analyzer) var #end val = head.item;
 		head = head.next;
 		head = head.next;
 		return val;
 		return val;
 	}
 	}