[sword-svn] r3502 - trunk/src/mgr

scribe at crosswire.org scribe at crosswire.org
Wed Nov 1 03:36:05 MST 2017


Author: scribe
Date: 2017-11-01 03:36:04 -0700 (Wed, 01 Nov 2017)
New Revision: 3502

Modified:
   trunk/src/mgr/swconfig.cpp
Log:
Minor possible optimization improvement using preincrementor

Modified: trunk/src/mgr/swconfig.cpp
===================================================================
--- trunk/src/mgr/swconfig.cpp	2017-11-01 10:36:00 UTC (rev 3501)
+++ trunk/src/mgr/swconfig.cpp	2017-11-01 10:36:04 UTC (rev 3502)
@@ -125,12 +125,12 @@
 	cfile = FileMgr::getSystemFileMgr()->open(getFileName().c_str(), FileMgr::RDWR|FileMgr::CREAT|FileMgr::TRUNC);
 	if (cfile->getFd() > 0) {
 		
-		for (sit = getSections().begin(); sit != getSections().end(); sit++) {
+		for (sit = getSections().begin(); sit != getSections().end(); ++sit) {
 			buf =  "\n[";
 			buf += (*sit).first.c_str();
 			buf += "]\n";
 			cfile->write(buf.c_str(), buf.length());
-			for (entry = (*sit).second.begin(); entry != (*sit).second.end(); entry++) {
+			for (entry = (*sit).second.begin(); entry != (*sit).second.end(); ++entry) {
 				buf = (*entry).first.c_str();
 				buf += "=";
 				buf += (*entry).second.c_str();
@@ -150,14 +150,14 @@
 	SectionMap::iterator section;
 	ConfigEntMap::iterator entry, start, end;
 
-	for (section = addFrom.getSections().begin(); section != addFrom.getSections().end(); section++) {
-		for (entry = (*section).second.begin(); entry != (*section).second.end(); entry++) {
+	for (section = addFrom.getSections().begin(); section != addFrom.getSections().end(); ++section) {
+		for (entry = (*section).second.begin(); entry != (*section).second.end(); ++entry) {
 			start = getSections()[section->first].lower_bound(entry->first);
 			end   = getSections()[section->first].upper_bound(entry->first);
 			if (start != end) {
 				if (((++start) != end)
 						|| ((++(addFrom.getSections()[section->first].lower_bound(entry->first))) != addFrom.getSections()[section->first].upper_bound(entry->first))) {
-					for (--start; start != end; start++) {
+					for (--start; start != end; ++start) {
 						if (!strcmp(start->second.c_str(), entry->second.c_str()))
 							break;
 					}




More information about the sword-cvs mailing list