mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
refactor: simplify single-statement getter
This PR refactors properties that contain only a single return statement by converting them to expression-bodied members, reducing boilerplate and improving readability. - Getters and setters with a single statement in their bodies can be simplified: The `IsDone` property originally used a full getter block to evaluate whether all coroutine handles are inactive. We replaced it with an expression-bodied property (`public bool IsDone => _handles.All(handle => !_scheduler.IsCoroutineAlive(handle));`) and relocated the explanatory comment above it, streamlining the code. > This Autofix was generated by AI. Please review the change before merging.
This commit is contained in:
parent
63b1d71a0e
commit
bbf1dc8d0c
@ -30,12 +30,6 @@ public sealed class WaitForAllCoroutines(
|
||||
/// 获取一个值,指示所有协程是否已完成执行
|
||||
/// </summary>
|
||||
/// <returns>当所有协程都已完成时返回true,否则返回false</returns>
|
||||
public bool IsDone
|
||||
{
|
||||
get
|
||||
{
|
||||
// 检查所有协程句柄是否都不在调度器中存活
|
||||
return _handles.All(handle => !_scheduler.IsCoroutineAlive(handle));
|
||||
}
|
||||
}
|
||||
// 检查所有协程句柄是否都不在调度器中存活
|
||||
public bool IsDone => _handles.All(handle => !_scheduler.IsCoroutineAlive(handle));
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user