Skip to content

Commit

Permalink
fixing formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Maclear committed Feb 9, 2011
1 parent d8a0687 commit 9abd451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions function-contrib-gollum/digraph_importer.textile
Expand Up @@ -88,8 +88,10 @@ map_edges(VTuple, [], _Ref, _Bucket) -> VTuple;
map_edges(VTuple, [H|T], Ref, Bucket) ->
{Edge, Src, Dest, _} = digraph:edge(Ref, H),
{value, {_, Links}} = lists:keysearch(Src, 1, VTuple),

NewLinks = Links++[{{Bucket, to_binary(Dest)}, to_binary(Edge)}],
NewVtuple = lists:keyreplace(Src, 1, VTuple, {Src, NewLinks}),

map_edges(NewVtuple, T, Ref, Bucket).


Expand All @@ -112,6 +114,7 @@ load_data(Client, {Vertex, LinkList}, Ref, Bucket, ContentType) ->
riakc_pb_socket:put(Client, MDObject),
io:format("Vertex: ~p~n", [Key]).


to_binary(Item) when is_atom(Item) ->
list_to_binary(atom_to_list(Item));
to_binary(Item) when is_list(Item) ->
Expand Down
2 changes: 2 additions & 0 deletions other/erlang/digraph_importer.erl
Expand Up @@ -47,8 +47,10 @@ map_edges(VTuple, [], _Ref, _Bucket) -> VTuple;
map_edges(VTuple, [H|T], Ref, Bucket) ->
{Edge, Src, Dest, _} = digraph:edge(Ref, H),
{value, {_, Links}} = lists:keysearch(Src, 1, VTuple),

NewLinks = Links++[{{Bucket, to_binary(Dest)}, to_binary(Edge)}],
NewVtuple = lists:keyreplace(Src, 1, VTuple, {Src, NewLinks}),

map_edges(NewVtuple, T, Ref, Bucket).


Expand Down

0 comments on commit 9abd451

Please sign in to comment.