Skip to content

Commit

Permalink
Optimize code size for scheduler.ts. (#18236)
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar authored Jan 23, 2025
1 parent 1f67480 commit 4b34ce3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cocos/core/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface ISchedulable {
* @en A list double-linked list used for "updates with priority".
* @zh 用于“优先更新”的列表。
* @class ListEntry
* @mangle
*/
class ListEntry {
public static get (target: ISchedulable, priority: number, paused: boolean, markedForDeletion: boolean): ListEntry {
Expand Down Expand Up @@ -105,6 +106,7 @@ class ListEntry {
* @param entry @en Entry in the list. @zh 所述的条目。
* @param target @en Hash key (retained). @zh 哈希键所对应的目标(被持有的)。
* @param callback @en The callback function. @zh 所回调的函数。
* @mangle
*/
class HashUpdateEntry {
public static get (list: ListEntry[], entry: ListEntry, target: ISchedulable, callback: AnyFunction | null): HashUpdateEntry {
Expand Down Expand Up @@ -151,6 +153,7 @@ class HashUpdateEntry {
* @param currentTimer
* @param currentTimerSalvaged
* @param paused
* @mangle
*/
class HashTimerEntry {
public static get (timers: CallbackTimer[] | null, target: ISchedulable, timerIndex: number, currentTimer: CallbackTimer | null, currentTimerSalvaged: boolean, paused: boolean): HashTimerEntry {

Check warning on line 159 in cocos/core/scheduler.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 198. Maximum allowed is 150
Expand Down Expand Up @@ -196,8 +199,9 @@ class HashTimerEntry {

type CallbackType = (dt?: number) => void;

/*
/**
* Light weight timer
* @mangle
*/
class CallbackTimer {
public static _timers: CallbackTimer[] = [];
Expand Down Expand Up @@ -755,6 +759,7 @@ export class Scheduler extends System {
* @param timerToUnschedule The timer to be unscheduled.
* @param target The target of the timer.
* @engineInternal
* @mangle
*/
public unscheduleForTimer (timerToUnschedule: CallbackTimer, target: ISchedulable): void {
const targetId = (target.uuid || target.id) as string;
Expand Down

0 comments on commit 4b34ce3

Please sign in to comment.