r254281 - Use std::begin() and std::end() instead of doing the same manually. NFC

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 29 19:11:10 PST 2015


Author: ctopper
Date: Sun Nov 29 21:11:10 2015
New Revision: 254281

URL: http://llvm.org/viewvc/llvm-project?rev=254281&view=rev
Log:
Use std::begin() and std::end() instead of doing the same manually. NFC

Modified:
    cfe/trunk/lib/Basic/VirtualFileSystem.cpp

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=254281&r1=254280&r2=254281&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Sun Nov 29 21:11:10 2015
@@ -962,8 +962,7 @@ class RedirectingFileSystemParser {
       KeyStatusPair("use-external-name", false),
     };
 
-    DenseMap<StringRef, KeyStatus> Keys(
-        &Fields[0], Fields + sizeof(Fields)/sizeof(Fields[0]));
+    DenseMap<StringRef, KeyStatus> Keys(std::begin(Fields), std::end(Fields));
 
     bool HasContents = false; // external or otherwise
     std::vector<std::unique_ptr<Entry>> EntryArrayContents;
@@ -1121,8 +1120,7 @@ public:
       KeyStatusPair("roots", true),
     };
 
-    DenseMap<StringRef, KeyStatus> Keys(
-        &Fields[0], Fields + sizeof(Fields)/sizeof(Fields[0]));
+    DenseMap<StringRef, KeyStatus> Keys(std::begin(Fields), std::end(Fields));
 
     // Parse configuration and 'roots'
     for (yaml::MappingNode::iterator I = Top->begin(), E = Top->end(); I != E;




More information about the cfe-commits mailing list