1 | package com.adventofcode.day02 | |
2 | ||
3 | class Passwords(private val passwordsAndPolicy: List<String>) { | |
4 | ||
5 | fun findAllValidForPolicy(policy: (String) -> Policy): List<Password> { | |
6 | return passwordsAndPolicy | |
7 | .map { it.split(":") } | |
8 |
1
1. findAllValidForPolicy : negated conditional → KILLED |
.map { Password(it[1].trim(), policy.invoke(it[0])) } |
9 |
1
1. findAllValidForPolicy : negated conditional → KILLED |
.filter { it.isValid() } |
10 |
1
1. findAllValidForPolicy : replaced return value with Collections.emptyList for com/adventofcode/day02/Passwords::findAllValidForPolicy → KILLED |
.toList() |
11 | } | |
12 | ||
13 | } | |
14 | ||
15 | ||
16 | ||
Mutations | ||
8 |
1.1 |
|
9 |
1.1 |
|
10 |
1.1 |