From 0dc4310b470c7e4355c0da67ca3373c3013cc9dd Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Sat, 30 Jul 2016 04:42:38 -0700 Subject: [SPARK-16694][CORE] Use for/foreach rather than map for Unit expressions whose side effects are required ## What changes were proposed in this pull request? Use foreach/for instead of map where operation requires execution of body, not actually defining a transformation ## How was this patch tested? Jenkins Author: Sean Owen Closes #14332 from srowen/SPARK-16694. --- graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphx/src') diff --git a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala index 96aa262a39..88b59a343a 100644 --- a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala +++ b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala @@ -62,7 +62,7 @@ class GraphSuite extends SparkFunSuite with LocalSparkContext { assert( graph.edges.count() === rawEdges.size ) // Vertices not explicitly provided but referenced by edges should be created automatically assert( graph.vertices.count() === 100) - graph.triplets.collect().map { et => + graph.triplets.collect().foreach { et => assert((et.srcId < 10 && et.srcAttr) || (et.srcId >= 10 && !et.srcAttr)) assert((et.dstId < 10 && et.dstAttr) || (et.dstId >= 10 && !et.dstAttr)) } -- cgit v1.2.3