summaryrefslogtreecommitdiffstats
path: root/src/sp-tref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-tref.cpp')
-rw-r--r--src/sp-tref.cpp10
1 files changed, 3 insertions, 7 deletions
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<SPObject *> 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<SPObject *>(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);