From 2d9be77260bf12acc540a6538d83a713c79a2164 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 20 Mar 2017 10:31:05 +0100 Subject: [PATCH] Clean up the code a bit refs #4991 --- lib/redis/rediswriter-utility.cpp | 8 +------- lib/remote/objectqueryhandler.cpp | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/redis/rediswriter-utility.cpp b/lib/redis/rediswriter-utility.cpp index 59d7880a7..8a6b918a0 100644 --- a/lib/redis/rediswriter-utility.cpp +++ b/lib/redis/rediswriter-utility.cpp @@ -77,15 +77,9 @@ Dictionary::Ptr RedisWriter::SerializeObjectAttrs(const Object::Ptr& object, int { Type::Ptr type = object->GetReflectionType(); - std::vector fids; - - for (int fid = 0; fid < type->GetFieldCount(); fid++) { - fids.push_back(fid); - } - Dictionary::Ptr resultAttrs = new Dictionary(); - for (int& fid : fids) { + for (int fid = 0; fid < type->GetFieldCount(); fid++) { Field field = type->GetFieldInfo(fid); if ((field.Attributes & fieldType) == 0) diff --git a/lib/remote/objectqueryhandler.cpp b/lib/remote/objectqueryhandler.cpp index 778aecfe4..836e4510a 100644 --- a/lib/remote/objectqueryhandler.cpp +++ b/lib/remote/objectqueryhandler.cpp @@ -83,7 +83,7 @@ Dictionary::Ptr ObjectQueryHandler::SerializeObjectAttrs(const Object::Ptr& obje Dictionary::Ptr resultAttrs = new Dictionary(); - for (int& fid : fids) + for (int fid : fids) { Field field = type->GetFieldInfo(fid);