File tree Expand file tree Collapse file tree
Sources/SQLiteData/CloudKit/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 }
2121
2222 mutating func saveRecord( _ record: CKRecord ) {
23- guard let existingEntry = storage [ record. recordID. zoneID] ? . entries [ record. recordID]
23+ guard var existingEntry = storage [ record. recordID. zoneID] ? . entries [ record. recordID]
2424 else {
2525 storage [ record. recordID. zoneID] ? . entries [ record. recordID] =
2626 RecordEntry ( record: record, history: [ : ] )
2727 return
2828 }
29- var updatedEntry = existingEntry
3029 if let existingRecordChangeTag = existingEntry. record. _recordChangeTag,
3130 let existingRecordCopy = existingEntry. record. copy ( ) as? CKRecord
3231 {
33- updatedEntry . history [ existingRecordChangeTag] = existingRecordCopy
32+ existingEntry . history [ existingRecordChangeTag] = existingRecordCopy
3433 }
35- updatedEntry . record = record
36- storage [ record. recordID. zoneID] ? . entries [ record. recordID] = updatedEntry
34+ existingEntry . record = record
35+ storage [ record. recordID. zoneID] ? . entries [ record. recordID] = existingEntry
3736 }
3837 }
3938
You can’t perform that action at this time.
0 commit comments