diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-10 10:14:45 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-10 10:14:45 +0100 |
commit | 5e8e882c7092feaaf4a56506dbda611ed7755d28 (patch) | |
tree | a47d7137b90f719773c1efc253cd40f4d85a42bd /src/lib/eina_graph_dfs.c | |
parent | b9cc34a3cc89992ad211bd6e5d6da61c435f46c7 (diff) | |
download | eina_graph-5e8e882c7092feaaf4a56506dbda611ed7755d28.zip eina_graph-5e8e882c7092feaaf4a56506dbda611ed7755d28.tar.gz |
use eina_array for adjacents list instead of custom implementation
Diffstat (limited to 'src/lib/eina_graph_dfs.c')
-rw-r--r-- | src/lib/eina_graph_dfs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/eina_graph_dfs.c b/src/lib/eina_graph_dfs.c index 2b1cc73..f958d41 100644 --- a/src/lib/eina_graph_dfs.c +++ b/src/lib/eina_graph_dfs.c @@ -38,7 +38,7 @@ _eina_graph_dfs_swalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, unsigned int v, unsigned int step) { Eina_Array *stack = NULL; - _Eina_Graph_Adjacents *adjs; + Eina_Array *adjs; _Eina_Graph_DFS_Data *vd; unsigned int p, w, n, i; @@ -57,11 +57,11 @@ _eina_graph_dfs_swalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, vd->e = p; p = w; - adjs = &_g->adjs[w]; - n = adjs->count; + adjs = _g->adjs[w]; + n = eina_array_count_get(adjs); for (i = 0; i < n; i++) { - w = adjs->data[i]; + w = eina_array_uint_nth_get(adjs, i); if (!_dfs->data[w].m) eina_array_push_uint(stack, w); } @@ -73,17 +73,17 @@ _eina_graph_dfs_swalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, static void _eina_graph_dfs_rwalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, unsigned int v) { - _Eina_Graph_Adjacents *adjs; + Eina_Array *adjs; _Eina_Graph_DFS_Data *vd; unsigned int i, n, w; _dfs->data[v].m = EINA_TRUE; - adjs = &_g->adjs[v]; - n = adjs->count; + adjs = _g->adjs[v]; + n = eina_array_count_get(adjs); for (i = 0; i < n; i++) { - w = adjs->data[i]; + w = eina_array_uint_nth_get(adjs, i); vd = &_dfs->data[w]; if (!vd->m) { |