File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/main/java/travelator/marketing Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,16 @@ import java.io.Writer
5
5
6
6
@Throws(IOException ::class )
7
7
fun generate (writer : Writer , lines : List <String >) {
8
- val resultLines = generate(lines)
9
- writer.append(resultLines.joinToString(" \n " ))
8
+ writer.append(generate(lines).joinToString(" \n " ))
10
9
}
11
10
12
11
fun generate (lines : List <String >): List <String > {
13
12
val valuableCustomers = lines
14
13
.toValuableCustomers()
15
14
.sortedBy(CustomerData ::score)
16
- val resultLines = listOf (" ID\t Name\t Spend" ) +
15
+ return listOf (" ID\t Name\t Spend" ) +
17
16
valuableCustomers.map(CustomerData ::outputLine) +
18
17
valuableCustomers.summarised()
19
- return resultLines
20
18
}
21
19
22
20
private fun List<String>.toValuableCustomers () = withoutHeader()
You can’t perform that action at this time.
0 commit comments