mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Drop the unnecessary @Sendable from the composer attribute enumeration
`NSMutableAttributedString.enumerateAttribute(_:in:options:using:)` runs its closure synchronously on the calling thread and its `using:` parameter isn't `@Sendable`. The explicit `@Sendable` on the closure literals was therefore unnecessary and was the only thing triggering the "capture of non-Sendable NSMutableAttributedString" and "mutation of captured var in concurrently- executing code" warnings. Removing it clears all six with no behaviour change.
This commit is contained in:
@@ -405,7 +405,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
||||
|
||||
repeat { // Don't enumerate and mutate at the same time, big no no
|
||||
shouldMakeAnotherPass = false
|
||||
attributedString.enumerateAttribute(.link, in: .init(location: 0, length: attributedString.length), options: []) { @Sendable value, range, stop in
|
||||
attributedString.enumerateAttribute(.link, in: .init(location: 0, length: attributedString.length), options: []) { value, range, stop in
|
||||
guard let value else { return }
|
||||
shouldMakeAnotherPass = true
|
||||
|
||||
@@ -429,7 +429,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
||||
|
||||
repeat {
|
||||
shouldMakeAnotherPass = false
|
||||
attributedString.enumerateAttribute(.MatrixAllUsersMention, in: .init(location: 0, length: attributedString.length), options: []) { @Sendable value, range, stop in
|
||||
attributedString.enumerateAttribute(.MatrixAllUsersMention, in: .init(location: 0, length: attributedString.length), options: []) { value, range, stop in
|
||||
guard value != nil else { return }
|
||||
|
||||
shouldMakeAnotherPass = true
|
||||
|
||||
Reference in New Issue
Block a user