@@ -19,7 +19,7 @@ class Router(private val size: Int) {
1919 fun addPacket (source : Int , destination : Int , timestamp : Int ): Boolean {
2020 if (map.containsKey(destination)) {
2121 var found = false
22- val list: ArrayList <IntArray > = map.get( destination) !!
22+ val list: ArrayList <IntArray > = map[ destination] !!
2323 for (i in list.indices.reversed()) {
2424 if (list[i][1 ] < timestamp) {
2525 break
@@ -33,7 +33,7 @@ class Router(private val size: Int) {
3333 }
3434 }
3535 if (map.containsKey(destination)) {
36- val list: ArrayList <IntArray > = map.get( destination) !!
36+ val list: ArrayList <IntArray > = map[ destination] !!
3737 list.add(intArrayOf(source, timestamp))
3838 cur++
3939 q.offer(intArrayOf(source, destination, timestamp))
@@ -55,7 +55,7 @@ class Router(private val size: Int) {
5555 return intArrayOf()
5656 }
5757 val temp = q.poll()
58- val list: ArrayList <IntArray > = map.get( temp[1 ]) !!
58+ val list: ArrayList <IntArray > = map[ temp[1 ]] !!
5959 list.removeAt(0 )
6060 if (list.isEmpty()) {
6161 map.remove(temp[1 ])
@@ -66,7 +66,7 @@ class Router(private val size: Int) {
6666
6767 fun getCount (destination : Int , startTime : Int , endTime : Int ): Int {
6868 if (map.containsKey(destination)) {
69- val list: ArrayList <IntArray > = map.get( destination) !!
69+ val list: ArrayList <IntArray > = map[ destination] !!
7070 var lower = - 1
7171 var higher = - 1
7272 for (i in list.indices) {
0 commit comments