Swift cleanup: remove duplicate or unnecessary initializers using default values
Signed-off-by: Bryan Montz <bryanmontz@me.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
6bf5293701
commit
0f1390f412
@@ -18,11 +18,7 @@ class EventGroup {
|
||||
return first.created_at
|
||||
}
|
||||
|
||||
init() {
|
||||
self.events = []
|
||||
}
|
||||
|
||||
init(events: [NostrEvent]) {
|
||||
init(events: [NostrEvent] = []) {
|
||||
self.events = events
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
import Foundation
|
||||
|
||||
class ZapGroup {
|
||||
var zaps: [Zapping]
|
||||
var msat_total: Int64
|
||||
var zappers: Set<String>
|
||||
var zaps: [Zapping] = []
|
||||
var msat_total: Int64 = 0
|
||||
var zappers = Set<String>()
|
||||
|
||||
var last_event_at: Int64 {
|
||||
guard let first = zaps.first else {
|
||||
@@ -46,12 +46,6 @@ class ZapGroup {
|
||||
return grp
|
||||
}
|
||||
|
||||
init() {
|
||||
self.zaps = []
|
||||
self.msat_total = 0
|
||||
self.zappers = Set()
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func insert(_ zap: Zapping) -> Bool {
|
||||
if !insert_uniq_sorted_zap_by_created(zaps: &zaps, new_zap: zap) {
|
||||
|
||||
Reference in New Issue
Block a user