diff --git a/std/haxe/Int64.hx b/std/haxe/Int64.hx index 4bebe90675a..25896103956 100644 --- a/std/haxe/Int64.hx +++ b/std/haxe/Int64.hx @@ -229,34 +229,30 @@ abstract Int64(__Int64) from __Int64 to __Int64 { @:op(++A) private inline function preIncrement():Int64 { this = copy(); - ++this.low; + this.low++; if (this.low == 0) - ++this.high; + this.high++; return cast this; } @:op(A++) private inline function postIncrement():Int64 { - this = copy(); - this.low++; - if (this.low == 0) - this.high++; - return cast this; + var ret = this; + preIncrement(); + return ret; } @:op(--A) private inline function preDecrement():Int64 { this = copy(); if (this.low == 0) - --this.high; - --this.low; + this.high--; + this.low--; return cast this; } @:op(A--) private inline function postDecrement():Int64 { - this = copy(); - if (this.low == 0) - this.high--; - this.low--; - return cast this; + var ret = this; + preDecrement(); + return ret; } /**