Skip to content

Commit 18a1013

Browse files
committed
Fix GraphNode.addEdge
1 parent 8e177de commit 18a1013

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
group = "vadyushkins"
88

9-
version = "1.0.3"
9+
version = "1.0.4"
1010

1111
repositories { mavenCentral() }
1212

src/main/kotlin/org/kotgll/benchmarks/Benchmarks.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ fun runCFGWithoutSPPF(
9898
.walk()
9999
.filter { it.isFile }
100100
.forEach { graphPath ->
101-
val graph = readGraphFromCSV(graphPath.path)
102101
val graphName = graphPath.nameWithoutExtension
103102
println("start:: $graphName")
103+
val graph = readGraphFromCSV(graphPath.path)
104104

105105
val resultPath = getResultPath(pathToOutput, graphName, "cfg", cfgName, "without_sppf")
106106
File(resultPath).writeText("")
@@ -147,9 +147,9 @@ fun runCFGWithSPPF(
147147
.walk()
148148
.filter { it.isFile }
149149
.forEach { graphPath ->
150-
val graph = readGraphFromCSV(graphPath.path)
151150
val graphName = graphPath.nameWithoutExtension
152151
println("start:: $graphName")
152+
val graph = readGraphFromCSV(graphPath.path)
153153

154154
val resultPath = getResultPath(pathToOutput, graphName, "cfg", cfgName, "with_sppf")
155155
File(resultPath).writeText("")
@@ -196,9 +196,9 @@ fun runRSMWithoutSPPF(
196196
.walk()
197197
.filter { it.isFile }
198198
.forEach { graphPath ->
199-
val graph = readGraphFromCSV(graphPath.path)
200199
val graphName = graphPath.nameWithoutExtension
201200
println("start:: $graphName")
201+
val graph = readGraphFromCSV(graphPath.path)
202202

203203
val resultPath = getResultPath(pathToOutput, graphName, "rsm", rsmName, "without_sppf")
204204
File(resultPath).writeText("")
@@ -245,9 +245,9 @@ fun runRSMWithSPPF(
245245
.walk()
246246
.filter { it.isFile }
247247
.forEach { graphPath ->
248-
val graph = readGraphFromCSV(graphPath.path)
249248
val graphName = graphPath.nameWithoutExtension
250249
println("start:: $graphName")
250+
val graph = readGraphFromCSV(graphPath.path)
251251

252252
val resultPath = getResultPath(pathToOutput, graphName, "rsm", rsmName, "with_sppf")
253253
File(resultPath).writeText("")

src/main/kotlin/org/kotgll/graph/GraphNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ class GraphNode(val id: Int, var isStart: Boolean = false, var isFinal: Boolean
1919

2020
fun addEdge(label: String, head: GraphNode) {
2121
if (!outgoingEdges.containsKey(label)) outgoingEdges[label] = ArrayList()
22-
if (!outgoingEdges[label]!!.contains(head)) outgoingEdges[label]!!.add(head)
22+
outgoingEdges[label]!!.add(head)
2323
}
2424
}

0 commit comments

Comments
 (0)