optimize logical and/or, initial null checking in flows

This commit is contained in:
dcode
2019-04-09 03:04:45 +02:00
parent c16c19e18d
commit da4a7751fd
73 changed files with 5920 additions and 6866 deletions

View File

@ -102,12 +102,12 @@ import { ArrayBufferView } from "./arraybuffer";
}
@operator.prefix("!")
private static __not(str: String): bool {
private static __not(str: String | null): bool {
return str === null || !str.length;
}
@operator("!=")
private static __ne(left: String, right: String): bool {
private static __ne(left: String | null, right: String | null): bool {
return !this.__eq(left, right);
}
@ -391,7 +391,7 @@ import { ArrayBufferView } from "./arraybuffer";
}
var result = NEWARRAY<String>(0);
var end = 0, start = 0, i = 0;
while ((end = this.indexOf(separator!, start)) != -1) {
while ((end = this.indexOf(separator, start)) != -1) {
let len = end - start;
if (len > 0) {
let out = allocate(<usize>len << 1);