]> granicus.if.org Git - icinga2/commitdiff
Clean up the code a bit
authorGunnar Beutner <gunnar.beutner@icinga.com>
Mon, 20 Mar 2017 09:31:05 +0000 (10:31 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 29 Mar 2017 08:17:03 +0000 (10:17 +0200)
refs #4991

lib/redis/rediswriter-utility.cpp
lib/remote/objectqueryhandler.cpp

index 59d7880a7b6d4abdd2b0d7f122c6f8761c45ffac..8a6b918a0d0504bae446a7d884f247acff011f77 100644 (file)
@@ -77,15 +77,9 @@ Dictionary::Ptr RedisWriter::SerializeObjectAttrs(const Object::Ptr& object, int
 {
        Type::Ptr type = object->GetReflectionType();
 
-       std::vector<int> 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)
index 778aecfe42a6dd5102684a6bbd921181f9781616..836e4510a3913f4b7928e88496bc9e07c11ca1bc 100644 (file)
@@ -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);