From ba58a697c9a8817e2c0a91e4af385d743ed209c5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 5 Sep 2017 23:28:28 +0200 Subject: 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. --- opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc-core/src/main') 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>: Component { * @return All edges whose destination is this node and have the given tag. */ inline fun 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 Node<*>.ingoing(tag: String) = * @return All edges whose source is this node and have the given tag. */ inline fun 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() -- cgit v1.2.3