From adb946f9845dff9f5a53010b38032247b30475c1 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 8 Oct 2017 20:35:23 +0200 Subject: Replace list by vector for nodelist var (hwpfilter) Change-Id: I693d01f63b8bd8b2c78bfd98e1f9310c965f65b2 Reviewed-on: https://gerrit.libreoffice.org/43262 Tested-by: Jenkins Reviewed-by: Julien Nabet --- hwpfilter/source/formula.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'hwpfilter/source/formula.cxx') diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx index c3d3b9ce4f2b..5ab06f91dd9b 100644 --- a/hwpfilter/source/formula.cxx +++ b/hwpfilter/source/formula.cxx @@ -613,12 +613,9 @@ void Formula::parse() if( res ){ makeMathML( res ); } - int count = nodelist.size(); - for( i = 0 ; i < count ; i++ ){ - const Node *tmpNode = nodelist.front(); - nodelist.pop_front(); - delete tmpNode; - } + for (const auto &node : nodelist) + delete node; + nodelist.clear(); } void Formula::trim() -- cgit