]> granicus.if.org Git - clang/commitdiff
Use back() instead of end()-1
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 22 Apr 2008 07:37:18 +0000 (07:37 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 22 Apr 2008 07:37:18 +0000 (07:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ExplodedGraph.cpp

index c184d1ec42f33ac48731f8b2c5a87ff9025dcca2..95904cd3878fea4f9948ea803bc6b2ffc34c2c8e 100644 (file)
@@ -82,8 +82,8 @@ ExplodedNodeImpl** ExplodedNodeImpl::NodeGroup::end() const {
     return (ExplodedNodeImpl**) (getPtr() ? &P+1 : NULL);
   else {
     // Dereferencing end() is undefined behaviour. The vector is not empty, so
-    // we can dereference the last elem (end()-1) and then add 1 to the result.
-    return const_cast<ExplodedNodeImpl**>(&*(getVector(getPtr()).end()-1)) + 1;
+    // we can dereference the last elem and then add 1 to the result.
+    return const_cast<ExplodedNodeImpl**>(&getVector(getPtr()).back()) + 1;
   }
 }