Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit 8dc5ad3

Browse files
authored
perf(TPTweakViewController): sort tweak entries to improve performance (#29)
Sort tweak entries by cell name before processing to optimize table view performance by reducing sorting overhead during display
1 parent 8b28e03 commit 8dc5ad3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Sources/TPTweak/TPTweakViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ public final class TPTweakViewController: UIViewController {
353353
.sorted(by: { $0.key < $1.key })
354354
.map { key, value in
355355
var footers = [String]()
356+
let sortedValue = value.sorted(by: { $0.cell < $1.cell })
356357
var cells = [TPTweakPickerViewController.Cell]()
357358

358-
for entry in value {
359+
for entry in sortedValue {
359360
cells.append(TPTweakPickerViewController.Cell(
360361
name: entry.cell,
361362
identifer: entry.getIdentifier(),

0 commit comments

Comments
 (0)