From c20891fabc8c3ee2251e0545878e06545b6f0cdd Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 1 Oct 2017 23:57:52 +0200 Subject: First batch --- src/sp-tref.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/sp-tref.cpp') diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 014876478..2655e219b 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -502,16 +502,12 @@ sp_tref_convert_to_tspan(SPObject *obj) // RECURSIVE CASE //////////////////// else { - GSList *l = NULL; + std::vector l; for (auto& child: obj->children) { sp_object_ref(&child, obj); - l = g_slist_prepend (l, &child); + l.push_back(&child); } - l = g_slist_reverse (l); - while (l) { - SPObject *child = reinterpret_cast(l->data); // We just built this list, so cast is safe. - l = g_slist_remove (l, child); - + for(auto child:l) { // Note that there may be more than one conversion happening here, so if it's not a // tref being passed into this function, the returned value can't be specifically known new_tspan = sp_tref_convert_to_tspan(child); -- cgit v1.2.3