diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-01 16:55:34 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-01 16:55:34 -0800 |
commit | 0acc2454cacb3ccab512b41b96cbaa024ebb0117 (patch) | |
tree | 9c84c96681fd13c2ffd96eb92da09884058c3fa0 /src/cnode/cnode-algorithm.cpp | |
parent | cf5c5f6a492bb92b25aeb880e46e9df2560a4c2e (diff) | |
download | vyatta-cfg-0acc2454cacb3ccab512b41b96cbaa024ebb0117.tar.gz vyatta-cfg-0acc2454cacb3ccab512b41b96cbaa024ebb0117.zip |
tweak map iterator usage
Diffstat (limited to 'src/cnode/cnode-algorithm.cpp')
-rw-r--r-- | src/cnode/cnode-algorithm.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cnode/cnode-algorithm.cpp b/src/cnode/cnode-algorithm.cpp index 9ac5404..9256e7c 100644 --- a/src/cnode/cnode-algorithm.cpp +++ b/src/cnode/cnode-algorithm.cpp @@ -143,10 +143,12 @@ _cmp_non_leaf_nodes(const CfgNode *cfg1, const CfgNode *cfg2, Cstore::sortNodes(cnodes); for (size_t i = 0; i < cnodes.size(); i++) { - bool in1 = (nmap1.find(cnodes[i]) != nmap1.end()); - bool in2 = (nmap2.find(cnodes[i]) != nmap2.end()); - CfgNode *c1 = (in1 ? nmap1[cnodes[i]] : NULL); - CfgNode *c2 = (in2 ? nmap2[cnodes[i]] : NULL); + Cstore::MapT<string, CfgNode *>::iterator p1 = nmap1.find(cnodes[i]); + Cstore::MapT<string, CfgNode *>::iterator p2 = nmap2.find(cnodes[i]); + bool in1 = (p1 != nmap1.end()); + bool in2 = (p2 != nmap2.end()); + CfgNode *c1 = (in1 ? p1->second : NULL); + CfgNode *c2 = (in2 ? p2->second : NULL); rcnodes1.push_back(c1); rcnodes2.push_back(c2); } |