No problem, I wasn't very clear in my earlier comment.  You might want something more like:

```scala
edgeDirection match {
  case EdgeDirection.Either => {
    graph.mapReducetriplets[Array[Edge[ED]]]( ... )
  }
}
```

This way you don't evaluate a match on every single edge.  That said, given that you are doing a more costly operation for each edge (i.e., array concatenation) its unlikely that this change will lead to a big gain.