From f127e585314b547e14c68ed167c551b2aad355ec Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Wed, 12 Dec 2012 06:27:19 -0800
Subject: [PATCH] remove duplicate code in Graph.hs

Also update the docstring of a function.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 htools/Ganeti/HTools/Graph.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/htools/Ganeti/HTools/Graph.hs b/htools/Ganeti/HTools/Graph.hs
index a5616ecd2..1fa350094 100644
--- a/htools/Ganeti/HTools/Graph.hs
+++ b/htools/Ganeti/HTools/Graph.hs
@@ -138,10 +138,10 @@ isColorable g = isUndirected g && not (hasLoop g)
 verticesColors :: VertColorMap -> [Graph.Vertex] -> [Color]
 verticesColors cMap = mapMaybe (`IntMap.lookup` cMap)
 
--- | Get the colors of a list of vertices.
+-- | Get the set of colors of a list of vertices.
 -- Any uncolored vertices are ignored.
 verticesColorSet :: VertColorMap -> [Graph.Vertex] -> IntSet.IntSet
-verticesColorSet cMap = IntSet.fromList . mapMaybe (`IntMap.lookup` cMap)
+verticesColorSet cMap = IntSet.fromList . verticesColors cMap
 
 -- | Get the colors of the neighbors of a vertex.
 neighColors :: Graph.Graph -> VertColorMap -> Graph.Vertex -> [Color]
-- 
GitLab