Skip to content

Commit 9fc45bd

Browse files
mokagioclaude
andcommitted
Enable SwiftLint rule: empty_count
Prefer `.isEmpty` over comparing `.count` to zero. 1 auto-fixed violation in `SPNoteListViewController+Extensions.swift`. Part of the Orchard SwiftLint rollout campaign. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 642575a commit 9fc45bd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.swiftlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ only_rules:
2323

2424
- duplicate_imports
2525

26+
# Prefer checking `isEmpty` over comparing `count` to zero.
27+
- empty_count
28+
2629
# Arguments can be omitted when matching enums with associated types if they
2730
# are not used.
2831
- empty_enum_arguments

Simplenote/Classes/SPNoteListViewController+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ extension SPNoteListViewController {
398398
trashButton.isEnabled = false
399399
return
400400
}
401-
trashButton.isEnabled = selectedRows.count > 0
401+
trashButton.isEnabled = !selectedRows.isEmpty
402402
}
403403
}
404404

0 commit comments

Comments
 (0)