Commit 07ac4aaf authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix variable names in Loader.assignIndices



This function can be applied to any type of class "Element" but its
internal variables used to refer to a list of tuples containing these
elements and their names as "nodes". Moreover it built a list of name to
indices tuples referring to it as "na" (which is not very clear).

Thus nodes becomes name_element, and na name_idx.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 00457f03
......@@ -117,11 +117,11 @@ lookupGroup ktg nname gname =
assignIndices :: (Element a) =>
[(String, a)]
-> (NameAssoc, Container.Container a)
assignIndices nodes =
let (na, idx_node) =
assignIndices name_element =
let (name_idx, idx_element) =
unzip . map (\ (idx, (k, v)) -> ((k, idx), (idx, setIdx v idx)))
. zip [0..] $ nodes
in (M.fromList na, Container.fromList idx_node)
. zip [0..] $ name_element
in (M.fromList name_idx, Container.fromList idx_element)
-- | For each instance, add its index to its primary and secondary nodes.
fixNodes :: Node.List
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment