From c9617fba8ae4d57d3166862fe466e91a581999cf Mon Sep 17 00:00:00 2001
From: "deepsource-autofix[bot]"
<62050782+deepsource-autofix[bot]@users.noreply.github.com>
Date: Thu, 5 Mar 2026 05:07:07 +0000
Subject: [PATCH] refactor: use equality operators when evaluating bool?
This PR replaces the use of null-coalescing defaults on nullable booleans with explicit equality checks across instance control methods. The changes make the intent clearer by ensuring only a true result is treated as a positive outcome.
- Consider using the equality operators when evaluating `bool?`: DeepSource flagged instances where `GetInstance(...)?... ?? false` was used to coerce a nullable bool to false implicitly. We replaced these patterns in `PauseOnInstance`, `ResumeOnInstance`, and `KillOnInstance` with `== true` comparisons. Using `== true` clearly indicates that only an explicit true value returns a positive result and avoids ambiguity when the value is null.
> This Autofix was generated by AI. Please review the change before merging.
---
GFramework.Godot/coroutine/Timing.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/GFramework.Godot/coroutine/Timing.cs b/GFramework.Godot/coroutine/Timing.cs
index 4d4542b..d512910 100644
--- a/GFramework.Godot/coroutine/Timing.cs
+++ b/GFramework.Godot/coroutine/Timing.cs
@@ -361,7 +361,7 @@ public partial class Timing : Node
/// 是否成功暂停
public static bool PauseCoroutine(CoroutineHandle handle)
{
- return GetInstance(handle.Key)?.PauseOnInstance(handle) ?? false;
+ return GetInstance(handle.Key)?.PauseOnInstance(handle) == true;
}
///
@@ -371,7 +371,7 @@ public partial class Timing : Node
/// 是否成功恢复
public static bool ResumeCoroutine(CoroutineHandle handle)
{
- return GetInstance(handle.Key)?.ResumeOnInstance(handle) ?? false;
+ return GetInstance(handle.Key)?.ResumeOnInstance(handle) == true;
}
///
@@ -381,7 +381,7 @@ public partial class Timing : Node
/// 是否成功终止
public static bool KillCoroutine(CoroutineHandle handle)
{
- return GetInstance(handle.Key)?.KillOnInstance(handle) ?? false;
+ return GetInstance(handle.Key)?.KillOnInstance(handle) == true;
}
///