Browse Source

Lua : Misc cleanup

Justin Donaldson 10 years ago
parent
commit
d8e067b86c
2 changed files with 2 additions and 4 deletions
  1. 1 1
      std/lua/_std/EReg.hx
  2. 1 3
      std/lua/_std/String.hx

+ 1 - 1
std/lua/_std/EReg.hx

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (C)2005-2012 Haxe Foundation
+ * Copyright (C)2005-2015 Haxe Foundation
  *
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * copy of this software and associated documentation files (the "Software"),

+ 1 - 3
std/lua/_std/String.hx

@@ -50,10 +50,8 @@ extern class String {
 		return this;
 		return this;
 	}
 	}
 	inline function substring( startIndex : Int, ?endIndex : Int ) : String {
 	inline function substring( startIndex : Int, ?endIndex : Int ) : String {
-		startIndex +=1;
 		if (endIndex == null) endIndex = this.length;
 		if (endIndex == null) endIndex = this.length;
-		else endIndex += 1;
-		return untyped this.sub(startIndex,endIndex);
+		return untyped lua.StringTools.sub(this, startIndex + 1,endIndex + 1);
 	}
 	}
 
 
 	inline function get_length() : Int {
 	inline function get_length() : Int {