diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-09-05 23:28:28 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-09-05 23:33:20 +0200 |
| commit | ba58a697c9a8817e2c0a91e4af385d743ed209c5 (patch) | |
| tree | df44ae7a057b1cf141a38e0bd1577ca2847f0ea2 | |
| parent | 482a4e93699cf8725da3505f7b883ca875210c63 (diff) | |
Fix bug in helper methods in Node
This change fixes a bug where an incorrect value was cast and returned
by helper methods in the Node module.
| -rw-r--r-- | opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt index d1e99f57..39d1a804 100644 --- a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt @@ -67,7 +67,7 @@ interface Node<out T: Entity<*>>: Component<T> { * @return All edges whose destination is this node and have the given tag. */ inline fun <reified T> Node<*>.ingoing(tag: String) = - ingoingEdges().filter { it.tag == tag }.map { it as T }.toSet() + ingoingEdges().filter { it.tag == tag }.map { it.label as T }.toSet() /** @@ -78,4 +78,4 @@ inline fun <reified T> Node<*>.ingoing(tag: String) = * @return All edges whose source is this node and have the given tag. */ inline fun <reified T> Node<*>.outgoing(tag: String) = - outgoingEdges().filter { it.tag == tag }.map { it as T }.toSet() + outgoingEdges().filter { it.tag == tag }.map { it.label as T }.toSet() |
