Skip to content
Snippets Groups Projects
Commit 6592be25 authored by Joseph E. Gonzalez's avatar Joseph E. Gonzalez
Browse files

slightly more efficient map operation

parent 0b3efbcf
No related branches found
No related tags found
No related merge requests found
...@@ -70,8 +70,13 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double) ...@@ -70,8 +70,13 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double)
* applied to each edge * applied to each edge
*/ */
def map[ED2: ClassManifest](iter: Iterator[ED2]): EdgePartition[ED2] = { def map[ED2: ClassManifest](iter: Iterator[ED2]): EdgePartition[ED2] = {
val newData = iter.toArray val newData = new Array[ED2](data.size)
assert(newData.size == data.size) var i = 0
while (iter.hasNext) {
newData(i) = iter.next()
i += 1
}
assert(newData.size == i)
new EdgePartition(srcIds, dstIds, newData, index) new EdgePartition(srcIds, dstIds, newData, index)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment