From 93650897c928bfa9ca9b737cfbff55c25271d5d3 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 00:34:32 +0100 Subject: cppification : GHashMaps replaced by stl maps. getResouceList now gives a std::set. Should give some performance improvements (quite a few linear lookups are now logarithmic) (bzr r14504.1.6) --- src/widgets/gradient-vector.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/widgets/gradient-vector.cpp') diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 8e92f589a..35c1e4a8d 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -298,11 +298,11 @@ static void sp_gvs_rebuild_gui_full(SPGradientVectorSelector *gvs) /* Pick up all gradients with vectors */ GSList *gl = NULL; if (gvs->gr) { - const GSList *gradients = gvs->gr->document->getResourceList("gradient"); - for (const GSList *curr = gradients; curr; curr = curr->next) { - SPGradient* grad = SP_GRADIENT(curr->data); + std::set gradients = gvs->gr->document->getResourceList("gradient"); + for (std::set::const_iterator it = gradients.begin(); it != gradients.end(); ++it) { + SPGradient* grad = SP_GRADIENT(*it); if ( grad->hasStops() && (grad->isSwatch() == gvs->swatched) ) { - gl = g_slist_prepend(gl, curr->data); + gl = g_slist_prepend(gl, *it); } } } -- cgit v1.2.3