@@ -91,6 +91,13 @@ package hl;
return 0;
}
+ #if (hl_ver >= version("1.10"))
+ @:hlNative("std","bytes_compare16")
+ public function compare16( bytes : Bytes, size : Int ) : Int {
+ return 0;
+ }
+ #end
+
@:hlNative("std","bytes_find")
public function find( pos : Int, size : Int, bytes : Bytes, bytesPos : Int, bytesSize : Int ) : Int {
@@ -210,7 +210,11 @@ class String {
var s = Std.instance(v, String);
if( s == null )
return hl.Api.comparePointer(this, v);
- var v = bytes.compare(0, s.bytes, 0, (length < s.length ? length : s.length) << 1);
+ var v = bytes.compare16(s.bytes, length < s.length ? length : s.length);
+ #else
+ var v = bytes.compare(0, s.bytes, 0, (length < s.length ? length : s.length) << 1);
return v == 0 ? length - s.length : v;