From 9b78c6dd32c3ffc0bbfac7e49bf1bb0aa053b47f Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sun, 30 Aug 2009 15:47:24 +0700 Subject: [PATCH] Preprocessor::getcfgs(): use std::list::unique() for removing duplicates. No functional change. --- src/preprocessor.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/preprocessor.cpp b/src/preprocessor.cpp index 4c32f770c..4870585c2 100644 --- a/src/preprocessor.cpp +++ b/src/preprocessor.cpp @@ -758,18 +758,8 @@ std::list Preprocessor::getcfgs(const std::string &filedata) } // Remove duplicates from the ret list.. - for (std::list::iterator it1 = ret.begin(); it1 != ret.end(); ++it1) - { - std::list::iterator it2 = it1; - ++it2; - while (it2 != ret.end()) - { - if (*it1 == *it2) - ret.erase(it2++); - else - ++it2; - } - } + ret.sort(); + ret.unique(); // cleanup unhandled configurations.. for (std::list::iterator it = ret.begin(); it != ret.end();) @@ -787,8 +777,6 @@ std::list Preprocessor::getcfgs(const std::string &filedata) ++it; } - ret.sort(); - return ret; }