Perf: Add final to classes that are not inherited (#574)

This commit is contained in:
Islam
2025-09-11 19:17:04 +02:00
committed by GitHub
parent 56f1c37129
commit e72fe50ffa
22 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -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: [])
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -14,7 +14,7 @@ import UIKit
import AppKit
#endif
class NotificationService {
final class NotificationService {
static let shared = NotificationService()
private init() {}
+1 -1
View File
@@ -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> = []
+1 -1
View File
@@ -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