From: Gunnar Beutner Date: Mon, 20 Mar 2017 09:31:05 +0000 (+0100) Subject: Clean up the code a bit X-Git-Tag: v2.7.0~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d9be77260bf12acc540a6538d83a713c79a2164;p=icinga2 Clean up the code a bit refs #4991 --- 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);