From 5262e78ed8ebe17543d3472fb6c5f3c30b7b3e40 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 7 Dec 2008 08:19:54 +0000 Subject: [PATCH] slightly more efficient iterator handling --- src/Environment/fgmetar.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Environment/fgmetar.cxx b/src/Environment/fgmetar.cxx index c172d92a7..a543832e7 100644 --- a/src/Environment/fgmetar.cxx +++ b/src/Environment/fgmetar.cxx @@ -104,9 +104,9 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co // clouds vector cv = _clouds; - vector::iterator cloud; + vector::iterator cloud, cv_end = cv.end(); - for (i = 0, cloud = cv.begin(); cloud != cv.end(); cloud++, i++) { + for (i = 0, cloud = cv.begin(); cloud != cv_end; ++cloud, i++) { int cov = cloud->getCoverage(); if (cov == -1) cov = 0; @@ -131,8 +131,8 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co // snow cover map rm = getRunways(); - map::const_iterator runway; - for (runway = rm.begin(); runway != rm.end(); runway++) { + map::const_iterator runway, rm_end = rm.end(); + for (runway = rm.begin(); runway != rm_end; ++runway) { SGMetarRunway rwy = runway->second; if (rwy.getDeposit() >= 3 ) { _snow_cover = true;