mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 18:25:19 +00:00
Perf: Add final to classes that are not inherited (#574)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
|
||||
/// Manages autocomplete functionality for chat
|
||||
class AutocompleteService {
|
||||
final class AutocompleteService {
|
||||
private let mentionRegex = try? NSRegularExpression(pattern: "@([\\p{L}0-9_]*)$", options: [])
|
||||
private let commandRegex = try? NSRegularExpression(pattern: "^/([a-z]*)$", options: [])
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ enum CommandResult {
|
||||
|
||||
/// Processes chat commands in a focused, efficient way
|
||||
@MainActor
|
||||
class CommandProcessor {
|
||||
final class CommandProcessor {
|
||||
weak var chatViewModel: ChatViewModel?
|
||||
weak var meshService: Transport?
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Combine
|
||||
|
||||
/// Manages persistent favorite relationships between peers
|
||||
@MainActor
|
||||
class FavoritesPersistenceService: ObservableObject {
|
||||
final class FavoritesPersistenceService: ObservableObject {
|
||||
|
||||
struct FavoriteRelationship: Codable {
|
||||
let peerNoisePublicKey: Data
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import Security
|
||||
import os.log
|
||||
|
||||
class KeychainManager {
|
||||
final class KeychainManager {
|
||||
static let shared = KeychainManager()
|
||||
|
||||
// Use consistent service name for all keychain items
|
||||
|
||||
@@ -135,7 +135,7 @@ enum EncryptionStatus: Equatable {
|
||||
/// Provides a high-level API for establishing secure channels between peers,
|
||||
/// handling all cryptographic operations transparently.
|
||||
/// - Important: This service maintains the device's cryptographic identity
|
||||
class NoiseEncryptionService {
|
||||
final class NoiseEncryptionService {
|
||||
// Static identity key (persistent across sessions)
|
||||
private let staticIdentityKey: Curve25519.KeyAgreement.PrivateKey
|
||||
public let staticIdentityPublicKey: Curve25519.KeyAgreement.PublicKey
|
||||
|
||||
@@ -14,7 +14,7 @@ import UIKit
|
||||
import AppKit
|
||||
#endif
|
||||
|
||||
class NotificationService {
|
||||
final class NotificationService {
|
||||
static let shared = NotificationService()
|
||||
|
||||
private init() {}
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import SwiftUI
|
||||
|
||||
/// Manages all private chat functionality
|
||||
class PrivateChatManager: ObservableObject {
|
||||
final class PrivateChatManager: ObservableObject {
|
||||
@Published var privateChats: [String: [BitchatMessage]] = [:]
|
||||
@Published var selectedPeer: String? = nil
|
||||
@Published var unreadMessages: Set<String> = []
|
||||
|
||||
@@ -13,7 +13,7 @@ import CryptoKit
|
||||
|
||||
/// Single source of truth for peer state, combining mesh connectivity and favorites
|
||||
@MainActor
|
||||
class UnifiedPeerService: ObservableObject, TransportPeerEventsDelegate {
|
||||
final class UnifiedPeerService: ObservableObject, TransportPeerEventsDelegate {
|
||||
|
||||
// MARK: - Published Properties
|
||||
|
||||
|
||||
Reference in New Issue
Block a user