Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
ab43455629
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      std/List.hx

+ 3 - 3
std/List.hx

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