2
0
Эх сурвалжийг харах

lint haxe.iterators.StringIterator (and overrides)

Justin Donaldson 5 жил өмнө
parent
commit
e0af6c662c

+ 24 - 24
std/haxe/iterators/StringIterator.hx

@@ -23,33 +23,33 @@
 package haxe.iterators;
 
 /**
-	This iterator can be used to iterate over char codes in a string.
+  This iterator can be used to iterate over char codes in a string.
 
-	Note that char codes may differ across platforms because of different
-	internal encoding of strings in different of runtimes.
-**/
+  Note that char codes may differ across platforms because of different
+  internal encoding of strings in different of runtimes.
+ **/
 class StringIterator {
-	var offset = 0;
-	var s:String;
+    var offset = 0;
+    var s:String;
 
-	/**
-		Create a new `StringIterator` over String `s`.
-	**/
-	public inline function new(s:String) {
-		this.s = s;
-	}
+    /**
+      Create a new `StringIterator` over String `s`.
+     **/
+    public inline function new(s:String) {
+        this.s = s;
+    }
 
-	/**
-		See `Iterator.hasNext`
-	**/
-	public inline function hasNext() {
-		return offset < s.length;
-	}
+    /**
+      See `Iterator.hasNext`
+     **/
+    public inline function hasNext() {
+        return offset < s.length;
+    }
 
-	/**
-		See `Iterator.next`
-	**/
-	public inline function next() {
-		return StringTools.fastCodeAt(s, offset++);
-	}
+    /**
+      See `Iterator.next`
+     **/
+    public inline function next() {
+        return StringTools.fastCodeAt(s, offset++);
+    }
 }

+ 8 - 8
std/lua/_std/haxe/iterators/StringIterator.hx

@@ -24,27 +24,27 @@ package haxe.iterators;
 import lua.lib.luautf8.Utf8;
 
 class StringIterator {
-    var codes : String->Int->StringCodePoint;
+    var codes : (String, Int)->StringCodePoint;
     var codepoint : Int;
     var str : String;
     var position : Int;
-	public inline function new(s:String) {
+    public inline function new(s:String) {
         this.codes = Utf8.codes(s);
         this.str = s;
         var cp = codes(str, 1);
         this.codepoint = cp.codepoint;
         this.position = cp.position;
-	}
+    }
 
-	public inline function hasNext() {
-		return codepoint != null;
-	}
+    public inline function hasNext() {
+        return codepoint != null;
+    }
 
-	public inline function next() {
+    public inline function next() {
         var ret = codepoint;
         var cp = codes(str, position);
         codepoint = cp.codepoint;
         position = cp.position;
         return ret;
-	}
+    }
 }