if (a) {
if (b) { ... }
else { c(); }
} else {
c();
}
只有 a && b 為真時執行 ...,其餘所有情況(!a 或 a && !b)均執行 c()。
if (a && b) {
// 原 a 為真且 b 為真的邏輯
} else {
c(); // 合併兩個 else 分支
}
// 原:if (lastSign != null && isToday(lastSign)) ...
// 簡化:直接用組合條件
if (lastSign == null || !isToday(lastSign)) {
// 執行簽到邏輯
}