From 9cfa329a77d3dfec4746ca307c6da1b3e904cbfa Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Wed, 12 Sep 2018 14:58:11 +0000 Subject: Use `ref<>` for UpdateNode Remove additional reference counting as part of UpdateNodeList and UpdateNode. Simplifies code. --- lib/Expr/ArrayExprOptimizer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Expr/ArrayExprOptimizer.cpp') diff --git a/lib/Expr/ArrayExprOptimizer.cpp b/lib/Expr/ArrayExprOptimizer.cpp index 60f2ca6e..d80cc3bc 100644 --- a/lib/Expr/ArrayExprOptimizer.cpp +++ b/lib/Expr/ArrayExprOptimizer.cpp @@ -284,7 +284,8 @@ ref ExprOptimizer::getSelectOptExpr( // reverse the list std::vector us; us.reserve(read->updates.getSize()); - for (const UpdateNode *un = read->updates.head; un; un = un->next) + for (const UpdateNode *un = read->updates.head.get(); un; + un = un->next.get()) us.push_back(un); auto arrayConstValues = read->updates.root->constantValues; @@ -366,7 +367,7 @@ ref ExprOptimizer::getSelectOptExpr( // reverse the list std::vector us; us.reserve(read->updates.getSize()); - for (const UpdateNode *un = read->updates.head; un; un = un->next) + for (const UpdateNode *un = read->updates.head.get(); un; un = un->next.get()) us.push_back(un); for (auto it = us.rbegin(); it != us.rend(); it++) { -- cgit 1.4.1