Skip to content

Commit 6741fa0

Browse files
committed
Fixed compile warning.
1 parent 3c6b68f commit 6741fa0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*/
4-
51
plugins {
62
kotlin("jvm") version "1.6.10"
73
jacoco
@@ -38,7 +34,6 @@ tasks.withType<JavaCompile>() {
3834

3935
tasks.jacocoTestReport {
4036
reports {
41-
html.isEnabled = true
42-
xml.isEnabled = true
37+
xml.required
4338
}
4439
}

src/main/kotlin/s0012_integer_to_roman/Solution.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package s0012_integer_to_roman
22

33
class Solution {
44
fun intToRoman(num: Int): String? {
5-
var num = num
5+
var localNum = num
66
val sb = StringBuilder()
77
val m = 1000
88
val c = 100
99
val x = 10
1010
val i = 1
11-
num = numerals(sb, num, m, ' ', ' ', 'M')
12-
num = numerals(sb, num, c, 'M', 'D', 'C')
13-
num = numerals(sb, num, x, 'C', 'L', 'X')
14-
numerals(sb, num, i, 'X', 'V', 'I')
11+
localNum = numerals(sb, localNum, m, ' ', ' ', 'M')
12+
localNum = numerals(sb, localNum, c, 'M', 'D', 'C')
13+
localNum = numerals(sb, localNum, x, 'C', 'L', 'X')
14+
numerals(sb, localNum, i, 'X', 'V', 'I')
1515
return sb.toString()
1616
}
1717

0 commit comments

Comments
 (0)