summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-11 22:21:41 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-11 22:21:41 +0000
commit0d955d0bf5cbbd50061309ad2c08c0dcf8f62039 (patch)
tree19991ceb4f16b4e3ce06fe2c39304d27a93b8b7b /llvm/unittests/Support/Path.cpp
parent332b3b22109e9c0d84456888150c0a30f378f984 (diff)
downloadbcm5719-llvm-0d955d0bf5cbbd50061309ad2c08c0dcf8f62039.tar.gz
bcm5719-llvm-0d955d0bf5cbbd50061309ad2c08c0dcf8f62039.zip
Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r--llvm/unittests/Support/Path.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 1a6ffa50e98..a1e13650cf1 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Path.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
@@ -677,16 +678,15 @@ TEST_F(FileSystemTest, DirectoryIteration) {
i.no_push();
visited.push_back(path::filename(i->path()));
}
- v_t::const_iterator a0 = std::find(visited.begin(), visited.end(), "a0");
- v_t::const_iterator aa1 = std::find(visited.begin(), visited.end(), "aa1");
- v_t::const_iterator ab1 = std::find(visited.begin(), visited.end(), "ab1");
- v_t::const_iterator dontlookhere = std::find(visited.begin(), visited.end(),
- "dontlookhere");
- v_t::const_iterator da1 = std::find(visited.begin(), visited.end(), "da1");
- v_t::const_iterator z0 = std::find(visited.begin(), visited.end(), "z0");
- v_t::const_iterator za1 = std::find(visited.begin(), visited.end(), "za1");
- v_t::const_iterator pop = std::find(visited.begin(), visited.end(), "pop");
- v_t::const_iterator p1 = std::find(visited.begin(), visited.end(), "p1");
+ v_t::const_iterator a0 = find(visited, "a0");
+ v_t::const_iterator aa1 = find(visited, "aa1");
+ v_t::const_iterator ab1 = find(visited, "ab1");
+ v_t::const_iterator dontlookhere = find(visited, "dontlookhere");
+ v_t::const_iterator da1 = find(visited, "da1");
+ v_t::const_iterator z0 = find(visited, "z0");
+ v_t::const_iterator za1 = find(visited, "za1");
+ v_t::const_iterator pop = find(visited, "pop");
+ v_t::const_iterator p1 = find(visited, "p1");
// Make sure that each path was visited correctly.
ASSERT_NE(a0, visited.end());
OpenPOWER on IntegriCloud