Skip to content

Commit 2bd6802

Browse files
committed
ch01: totalAmount 변수 인라인 후 함수 이름 바꾸기
1 parent aa2c4ea commit 2bd6802

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/kotlin/chapter01/Statement.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fun statement(invoice: Invoice, plays: Plays): String {
5353
return volumeCredits
5454
}
5555

56-
fun 임시(): Int {
56+
fun totalAmount(): Int {
5757
var totalAmount = 0
5858
for (perf in invoice.performances) {
5959
totalAmount += amountFor(perf)
@@ -67,9 +67,7 @@ fun statement(invoice: Invoice, plays: Plays): String {
6767
result += " ${playFor(perf).name}: ${usd(amountFor(perf))} (${perf.audience}석)\n"
6868
}
6969

70-
var totalAmount = 임시()
71-
72-
result += "총액: ${usd(totalAmount)}\n"
70+
result += "총액: ${usd(totalAmount())}\n"
7371
result += "적립 포인트: ${totalVolumeCredits()}"
7472
return result
7573
}

0 commit comments

Comments
 (0)