]> granicus.if.org Git - graphviz/commitdiff
rephrase delete loop in Blocks::~Blocks to a range-based for-loop
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 18:31:59 +0000 (11:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Jun 2021 04:28:45 +0000 (21:28 -0700)
lib/vpsc/blocks.cpp

index 72d74a42b250c76df7e5e6cd046aa42aaf6f31c9..3c2b97e7f03c56e52ebd0e51fd0ca57672503a9d 100644 (file)
@@ -43,8 +43,8 @@ Blocks::Blocks(const int n, Variable *vs[]) : vs(vs),nvs(n) {
 Blocks::~Blocks()
 {
        blockTimeCtr=0;
-       for(set<Block*>::iterator i=begin();i!=end();i++) {
-               delete *i;
+       for (Block *b : *this) {
+               delete b;
        }
 }