From: Tim Düsterhus Date: Wed, 18 Nov 2020 14:14:59 +0000 (+0100) Subject: Make WoltLabSuite/Core/List a proper generic class X-Git-Tag: 5.4.0_Alpha_1~598 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac66f47ff7d7110fbb7960156e7fdea68a4f0296;p=GitHub%2FWoltLab%2FWCF.git Make WoltLabSuite/Core/List a proper generic class --- diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/List.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/List.ts index d09d715dbf..6863b5f8f8 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/List.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/List.ts @@ -11,13 +11,13 @@ import * as Core from "./Core"; /** @deprecated 5.4 Use a `Set` instead. */ -class List { - private _set = new Set(); +class List { + private _set = new Set(); /** * Appends an element to the list, silently rejects adding an already existing value. */ - add(value: any): void { + add(value: T): void { this._set.add(value); } @@ -31,21 +31,21 @@ class List { /** * Removes an element from the list, returns true if the element was in the list. */ - delete(value: any): boolean { + delete(value: T): boolean { return this._set.delete(value); } /** * Invokes the `callback` for each element in the list. */ - forEach(callback: (value: any) => void): void { + forEach(callback: (value: T) => void): void { this._set.forEach(callback); } /** * Returns true if the list contains the element. */ - has(value: any): boolean { + has(value: T): boolean { return this._set.has(value); }