8000 methods-to-properties.3 : single-expression · test-driven-development/code@da03240 · GitHub
[go: up one dir, main page]

Skip to content

Commit da03240

Browse files
Duncan McGregordmcg
authored andcommitted
methods-to-properties.3 : single-expression
1 parent 120d765 commit da03240

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/java/travelator/CampSite.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ data class CampSite(
88
val countryCode: String
99
get() = address.countryCode
1010

11-
val region: String
12-
get() {
13-
return address.region
14-
}
15-
}
11+
val region: String get() = address.region
12+
}

src/main/java/travelator/CampSites.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static Set<CampSite> sitesInRegion(
1414
return sites.stream()
1515
.filter( campSite ->
1616
campSite.getCountryCode().equals(countryISO) &&
17-
campSite.getRegion().equalsIgnoreCase(region)
17+
campSite.getRegion().equalsIgnoreCase(region) // <1>
1818
)
1919
.collect(toUnmodifiableSet());
2020
}

0 commit comments

Comments
 (0)
0