Changeset - 76dda381db24
[Not reviewed]
0 1 0
HanzZ - 12 years ago 2013-02-12 18:22:57
hanzz.k@gmail.com
Use iterator in pqxx storage backend
1 file changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/pqxxbackend.cpp
Show inline comments
 
@@ -295,12 +295,12 @@ bool PQXXBackend::getBuddies(long id, std::list<BuddyInfo> &roster) {
 
			BuddyInfo b;
 
			std::string group;
 

	
 
			b.id = r[0][0].as<long>();
 
			b.legacyName = r[0][1].as<std::string>();
 
			b.subscription = r[0][2].as<std::string>();
 
			b.alias = r[0][3].as<std::string>();
 
			group = r[0][4].as<std::string>();
 
			b.flags = r[0][5].as<long>();
 
			b.id = (*it)[0].as<long>();
 
			b.legacyName = (*it)[1].as<std::string>();
 
			b.subscription = (*it)[2].as<std::string>();
 
			b.alias = (*it)[3].as<std::string>();
 
			group = (*it)[4].as<std::string>();
 
			b.flags = (*it)[5].as<long>();
 

	
 
			if (!group.empty()) {
 
				b.groups = StorageBackend::deserializeGroups(group);
 
@@ -317,10 +317,10 @@ bool PQXXBackend::getBuddies(long id, std::list<BuddyInfo> &roster) {
 
			std::string key;
 
			std::string val;
 

	
 
			buddy_id = r[0][0].as<long>();
 
			var.type = r[0][1].as<long>();
 
			key = r[0][2].as<std::string>();
 
			val = r[0][3].as<std::string>();
 
			buddy_id = (*it)[0].as<long>();
 
			var.type = (*it)[1].as<long>();
 
			key = (*it)[2].as<std::string>();
 
			val = (*it)[3].as<std::string>();
 
			switch (var.type) {
 
				case TYPE_BOOLEAN:
 
					var.b = atoi(val.c_str());
0 comments (0 inline, 0 general)