Skip to content

Commit d82cb3e

Browse files
author
Takashi Kinjo
committed
Rename findAny to findFirst
1 parent 3887c0d commit d82cb3e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ii_collections/n15AllAnyAndOtherPredicates.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fun Shop.countCustomersFrom(city: City): Int {
3333
todoCollectionTask()
3434
}
3535

36-
fun Shop.findAnyCustomerFrom(city: City): Customer? {
37-
// Return a customer who lives in the given city, or null if there is none
36+
fun Shop.findFirstCustomerFrom(city: City): Customer? {
37+
// Return the first customer who lives in the given city, or null if there is none
3838
todoCollectionTask()
3939
}

test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class N15AllAnyAndOtherPredicatesKtTest {
2222
assertEquals(2, shop.countCustomersFrom(Canberra))
2323
}
2424

25-
@Test fun testAnyCustomerFromCity() {
26-
assertEquals(customers[lucas], shop.findAnyCustomerFrom(Canberra))
27-
assertEquals(null, shop.findAnyCustomerFrom(City("Chicago")))
25+
@Test fun testFirstCustomerFromCity() {
26+
assertEquals(customers[lucas], shop.findFirstCustomerFrom(Canberra))
27+
assertEquals(null, shop.findFirstCustomerFrom(City("Chicago")))
2828
}
2929
}

0 commit comments

Comments
 (0)