From 069f2440c471e89dfe2ecf6778bbab16e9fbe491 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Feb 2015 20:07:20 +0100 Subject: cmListCommand: Convert loop to find algorithm. --- Source/cmListCommand.cxx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 22d8b0e..826632f 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -104,19 +104,8 @@ bool cmListCommand::GetList(std::vector& list, } // expand the variable into a list cmSystemTools::ExpandListArgument(listString, list, true); - // check the list for empty values - bool hasEmpty = false; - for(std::vector::iterator i = list.begin(); - i != list.end(); ++i) - { - if(i->empty()) - { - hasEmpty = true; - break; - } - } // if no empty elements then just return - if(!hasEmpty) + if (std::find(list.begin(), list.end(), std::string()) == list.end()) { return true; } -- cgit v0.12