mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 14:31:28 +00:00
Minor string comparision optimizations (#77)
This commit is contained in:
@ -111,8 +111,7 @@ export class String {
|
||||
@operator("==")
|
||||
private static __eq(left: String, right: String): bool {
|
||||
if (left === right) return true;
|
||||
if (left === null) return right === null;
|
||||
if (right === null) return false;
|
||||
if (left === null || right === null) return false;
|
||||
|
||||
var leftLength = left.length;
|
||||
if (leftLength != right.length) return false;
|
||||
@ -150,8 +149,7 @@ export class String {
|
||||
@operator(">=")
|
||||
private static __gte(left: String, right: String): bool {
|
||||
if (left === right) return true;
|
||||
if (left === null) return right === null;
|
||||
if (right === null) return false;
|
||||
if (left === null || right === null) return false;
|
||||
|
||||
var leftLength = left.length;
|
||||
var rightLength = right.length;
|
||||
@ -188,8 +186,7 @@ export class String {
|
||||
@operator("<=")
|
||||
private static __lte(left: String, right: String): bool {
|
||||
if (left === right) return true;
|
||||
if (left === null) return right === null;
|
||||
if (right === null) return false;
|
||||
if (left === null || right === null) return false;
|
||||
|
||||
var leftLength = left.length;
|
||||
var rightLength = right.length;
|
||||
|
Reference in New Issue
Block a user