Skip to content

Commit 46570f8

Browse files
authored
Fixed compiler warnings
1 parent ce09488 commit 46570f8

File tree

4 files changed

+9
-9
lines changed
  • src
    • main/kotlin
      • g3201_3300/s3273_minimum_amount_of_damage_dealt_to_bob
      • g3301_3400
        • s3321_find_x_sum_of_all_k_long_subarrays_ii
        • s3382_maximum_area_rectangle_with_point_constraints_ii
    • test/kotlin/g3301_3400/s3310_remove_methods_from_project

4 files changed

+9
-9
lines changed

src/main/kotlin/g3201_3300/s3273_minimum_amount_of_damage_dealt_to_bob/Solution.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class Solution {
2222
}
2323

2424
internal class Pair(var key: Int, var `val`: Int) : Comparable<Pair> {
25-
override fun compareTo(p: Pair): Int {
26-
return `val` * p.key - key * p.`val`
25+
override fun compareTo(other: Pair): Int {
26+
return `val` * other.key - key * other.`val`
2727
}
2828
}
2929
}

src/main/kotlin/g3301_3400/s3321_find_x_sum_of_all_k_long_subarrays_ii/Solution.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class Solution {
1616
cnt = c
1717
}
1818

19-
override fun compareTo(o: RC): Int {
20-
if (cnt != o.cnt) {
21-
return cnt - o.cnt
19+
override fun compareTo(other: RC): Int {
20+
if (cnt != other.cnt) {
21+
return cnt - other.cnt
2222
}
23-
return `val` - o.`val`
23+
return `val` - other.`val`
2424
}
2525
}
2626

src/main/kotlin/g3301_3400/s3382_maximum_area_rectangle_with_point_constraints_ii/Solution.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class Solution {
4545
}
4646

4747
private class Pair(val x: Int, val y: Int) : Comparable<Pair> {
48-
override fun compareTo(p: Pair): Int {
49-
return if (x == p.x) y - p.y else x - p.x
48+
override fun compareTo(other: Pair): Int {
49+
return if (x == other.x) y - other.y else x - other.x
5050
}
5151
}
5252
}

src/test/kotlin/g3301_3400/s3310_remove_methods_from_project/SolutionTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal class SolutionTest {
2929
fun remainingMethods3() {
3030
assertThat<List<Int>>(
3131
Solution().remainingMethods(3, 2, arrayOf<IntArray>(intArrayOf(1, 2), intArrayOf(0, 1), intArrayOf(2, 0))),
32-
equalTo<List<out Any>>(listOf<Any>()),
32+
equalTo<List<Int>>(listOf<Int>()),
3333
)
3434
}
3535
}

0 commit comments

Comments
 (0)