Skip to content

Commit a48565c

Browse files
authored
fix: example in 01_List.md (Kotlin#144)
addSudoer() actually adds newUser to systemUsers, not sudoers. So it looks better renaming addSudoer() to addSystemUser().
1 parent a398e3f commit a48565c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/05_Collections/01_List.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A [list](https://kotlinlang.org/docs/reference/collections.html) is an ordered c
66
val systemUsers: MutableList<Int> = mutableListOf(1, 2, 3) // 1
77
val sudoers: List<Int> = systemUsers // 2
88
9-
fun addSudoer(newUser: Int) { // 3
9+
fun addSystemUser(newUser: Int) { // 3
1010
systemUsers.add(newUser)
1111
}
1212
@@ -15,7 +15,7 @@ fun getSysSudoers(): List<Int> { // 4
1515
}
1616
1717
fun main() {
18-
addSudoer(4) // 5
18+
addSystemUser(4) // 5
1919
println("Tot sudoers: ${getSysSudoers().size}") // 6
2020
getSysSudoers().forEach { // 7
2121
i -> println("Some useful info on user $i")

0 commit comments

Comments
 (0)