Ensure consistent variable modifiers

'var' is a distinct local or mutable global, 'let' a shared local
This commit is contained in:
dcodeIO
2018-03-13 02:32:10 +01:00
parent 7ee6e1cf7b
commit 23a7db4dc3
33 changed files with 736 additions and 570 deletions

View File

@ -21,7 +21,7 @@ export class Set<T> {
has(value: T): bool {
assert(this != null);
for (var index: usize = 0, limit: usize = this.__size; index < limit; ++index) {
for (let index: usize = 0, limit: usize = this.__size; index < limit; ++index) {
if (load<T>(this.__memory + index * sizeof<T>()) == value) {
return true;
}
@ -33,8 +33,8 @@ export class Set<T> {
assert(this != null);
if (this.__size >= this.__capacity) {
var newCapacity = max(this.__capacity << 1, 8);
var newMemory = allocate_memory(<usize>newCapacity * sizeof<T>());
let newCapacity = max(this.__capacity << 1, 8);
let newMemory = allocate_memory(<usize>newCapacity * sizeof<T>());
if (this.__memory) {
move_memory(newMemory, this.__memory, <usize>this.__capacity * sizeof<T>());
free_memory(this.__memory);
@ -50,7 +50,7 @@ export class Set<T> {
delete(value: T): bool {
assert(this != null);
for (var index: usize = 0, limit: usize = this.__size; index < limit; ++index) {
for (let index: usize = 0, limit: usize = this.__size; index < limit; ++index) {
if (load<T>(this.__memory + index * sizeof<T>()) == value) {
if (index + 1 < limit) {
move_memory(