Skip to content

Commit 8212e88

Browse files
committed
Remove unused method for StorePickerViewModel
1 parent 77faa56 commit 8212e88

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewModel.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,6 @@ extension StorePickerViewModel {
146146
}
147147
return resultsController.safeObject(at: indexPath)
148148
}
149-
150-
/// Returns the IndexPath for the specified Site.
151-
///
152-
func indexPath(for siteID: Int64) -> IndexPath? {
153-
guard resultsController.numberOfObjects > 0 else {
154-
return nil
155-
}
156-
157-
for (sectionIndex, section) in resultsController.sections.enumerated() {
158-
if let rowIndex = section.objects.firstIndex(where: { $0.siteID == siteID }) {
159-
return IndexPath(row: rowIndex, section: sectionIndex)
160-
}
161-
}
162-
return nil
163-
}
164149
}
165150

166151
private extension StorePickerViewModel {

WooCommerce/WooCommerceTests/Authentication/StorePickerViewModelTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ final class StorePickerViewModelTests: XCTestCase {
109109
XCTAssertEqual(viewModel.titleForSection(at: 0), Localization.connectedStore)
110110
XCTAssertEqual(viewModel.numberOfRows(inSection: 0), 1)
111111
XCTAssertEqual(viewModel.site(at: IndexPath(row: 0, section: 0))?.siteID, testSite1.siteID)
112-
XCTAssertEqual(viewModel.indexPath(for: testSite1.siteID), IndexPath(row: 0, section: 0))
113112
}
114113

115114
func test_table_view_configs_are_correct_for_list_with_both_woo_and_non_woo_sites() {
@@ -143,7 +142,6 @@ final class StorePickerViewModelTests: XCTestCase {
143142
XCTAssertEqual(viewModel.numberOfRows(inSection: 1), 1)
144143
XCTAssertEqual(viewModel.site(at: IndexPath(row: 1, section: 0))?.siteID, testSite2.siteID)
145144
XCTAssertEqual(viewModel.site(at: IndexPath(row: 0, section: 1))?.siteID, testSite3.siteID)
146-
XCTAssertEqual(viewModel.indexPath(for: testSite3.siteID), IndexPath(row: 0, section: 1))
147145
}
148146

149147
func test_trackScreenView_tracks_both_number_of_woo_and_non_woo_sites() throws {

0 commit comments

Comments
 (0)