Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/com/github/hcsp/datatype/Light.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ public Light(Boolean on) {

// 当灯亮时返回true,灭和未知状态返回false
public boolean isOn() {
return on;
if (on == null || on == false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不必要的条件逻辑。
表达式可被简化。

return false;
}else{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'}' 后应有空格。
'else' 后应有空格。
'else' 前应有空格。
'{' 前应有空格。

return true;
}
}

public Boolean isOnRawValue() {
Expand Down