From 3add3a4cfe5016713a52d0482293b302d0b959eb Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Thu, 24 May 2018 21:35:10 +0200 Subject: Relax input type --- vespajlib/src/main/java/com/yahoo/graph/Traversals.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vespajlib/src/main/java/com/yahoo/graph/Traversals.java b/vespajlib/src/main/java/com/yahoo/graph/Traversals.java index a3567b7a974..b69d67476e3 100644 --- a/vespajlib/src/main/java/com/yahoo/graph/Traversals.java +++ b/vespajlib/src/main/java/com/yahoo/graph/Traversals.java @@ -2,7 +2,6 @@ package com.yahoo.graph; import java.util.ArrayDeque; import java.util.ArrayList; -import java.util.Collection; import java.util.Deque; import java.util.HashMap; import java.util.Iterator; @@ -26,7 +25,7 @@ public class Traversals { * @param children A function mapping a node to its children. * @param The node type. * @return A topologically ordered iterable over the given nodes. - */ + */ public static Iterable topologically(Iterable nodes, Function> children) { return () -> new Iterator() { @@ -105,7 +104,7 @@ public class Traversals { * @param The node type. * @return The given edge set, but with all edges reversed. */ - public static Function> reversed(Collection nodes, Function> edges) { + public static Function> reversed(Iterable nodes, Function> edges) { Map> reverse = new HashMap<>(); for (T node : nodes) reverse.put(node, new ArrayList<>()); -- cgit v1.2.3