提交 87462bb8 编写于 作者: S Sandeep Somavarapu

clean up in array set

上级 ac3b2005
......@@ -111,7 +111,7 @@ export class PagedModel<T> implements IPagedModel<T> {
page.promiseIndexes.unset(index);
if (page.promiseIndexes.elements.length === 0) {
if (page.promiseIndexes.size === 0) {
page.promise.cancel();
}
});
......
......@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export class ArraySet<T> {
private _elements: T[];
......@@ -13,6 +11,10 @@ export class ArraySet<T> {
this._elements = elements.slice();
}
get size(): number {
return this._elements.length;
}
set(element: T): void {
this.unset(element);
this._elements.push(element);
......@@ -31,6 +33,6 @@ export class ArraySet<T> {
}
get elements(): T[] {
return this._elements;
return this._elements.slice();
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册