Skip to content

Commit 41d307b

Browse files
authored
Merge pull request #1120 from SimonMarquis/enum-entries
Replace `Enum.values()` with `Enum.entries`
2 parents 607b232 + be9dc53 commit 41d307b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class NiaAppState(
115115
* Map of top level destinations to be used in the TopBar, BottomBar and NavRail. The key is the
116116
* route.
117117
*/
118-
val topLevelDestinations: List<TopLevelDestination> = TopLevelDestination.values().asList()
118+
val topLevelDestinations: List<TopLevelDestination> = TopLevelDestination.entries
119119

120120
/**
121121
* The top level destinations that have unread news resources.

benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/ScrollTopicListPowerMetricsBenchmark.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ScrollTopicListPowerMetricsBenchmark {
4545
@get:Rule
4646
val benchmarkRule = MacrobenchmarkRule()
4747

48-
private val categories = PowerCategory.values()
48+
private val categories = PowerCategory.entries
4949
.associateWith { PowerCategoryDisplayLevel.TOTAL }
5050

5151
@Test

core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fun <A : ComponentActivity> AndroidComposeTestRule<ActivityScenarioRule<A>, A>.c
5353
screenshotName: String,
5454
body: @Composable () -> Unit,
5555
) {
56-
DefaultTestDevices.values().forEach {
56+
DefaultTestDevices.entries.forEach {
5757
this.captureForDevice(it.description, it.spec, screenshotName, body = body)
5858
}
5959
}

0 commit comments

Comments
 (0)