Skip to content

Commit 71180f2

Browse files
authored
improve proto conversion batching (#1798)
1 parent f04c034 commit 71180f2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

codepropertygraph/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoCpgLoader.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ object ProtoCpgLoader {
4343
val cpg = openOrCreateCpg(storagePath)
4444

4545
// first pass: add the raw nodes without any properties or edges
46-
protoCpgs().foreach { cpgProto =>
47-
addNodesRaw(nodesIter(cpgProto), cpg.graph, protoToGraphNodeMappings)
48-
}
46+
addNodesRaw(protoCpgs().flatMap(cpgProto => nodesIter(cpgProto)), cpg.graph, protoToGraphNodeMappings)
4947

5048
// second pass: set node properties and add edges
5149
val diffGraph = Cpg.newDiffGraphBuilder

0 commit comments

Comments
 (0)