damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit ecd8b64b8bc3dfc613eb2e81038bafaef053c6f3
parent 0c627ae0a026c332f7ed096a58237d9caaaf3240
Author: Bryan Montz <bryanmontz@me.com>
Date:   Sun, 16 Jul 2023 08:00:51 -0500

Swift cleanup: prefer case list over fallthrough in switch statements

Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/ContentView.swift | 5+----
Mdamus/Models/HomeModel.swift | 7++-----
Mdamus/Views/Notifications/EventGroupView.swift | 3+--
3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -490,10 +490,7 @@ struct ContentView: View { selected_timeline = .dms damus_state.dms.set_active_dm(target.pubkey) navigationCoordinator.push(route: Route.DMChat(dms: damus_state.dms.active_model)) - case .like: fallthrough - case .zap: fallthrough - case .mention: fallthrough - case .repost: + case .like, .zap, .mention, .repost: open_event(ev: target) case .profile_zap: // Handled separately above. diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift @@ -165,9 +165,7 @@ class HomeModel { } switch kind { - case .chat: fallthrough - case .longform: fallthrough - case .text: + case .chat, .longform, .text: handle_text_event(sub_id: sub_id, ev) case .contacts: handle_contact_event(sub_id: sub_id, relay_id: relay_id, ev: ev) @@ -862,8 +860,7 @@ func guard_valid_event(events: EventCache, ev: NostrEvent, callback: @escaping ( case .ok: callback() - case .bad_id: fallthrough - case .bad_sig: + case .bad_id, .bad_sig: break } } diff --git a/damus/Views/Notifications/EventGroupView.swift b/damus/Views/Notifications/EventGroupView.swift @@ -182,8 +182,7 @@ func reacting_to_verb(group: EventGroupType) -> String { return "reacted" case .repost: return "reposted" - case .zap: fallthrough - case .profile_zap: + case .zap, .profile_zap: return "zapped" } }