Skip to content

Commit c2b4ee0

Browse files
committed
Removing '_numPrimitivesProperties' which really doesn't need to be here
1 parent a682368 commit c2b4ee0

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/property/PropertyContainer.cpp

+10-15
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
******************************************************************************/
3131

3232
PropertyContainer::PropertyContainer()
33-
: _numPrimitivesProperties{0}
34-
, _get_time_func{nullptr}
33+
: _get_time_func{nullptr}
3534
{
3635

3736
}
@@ -54,7 +53,6 @@ Property & PropertyContainer::addPropertyReal(Property & property, String const
5453
/* Initialize property and add it to the container */
5554
property.init(name, permission, _get_time_func);
5655

57-
if (property.isPrimitive()) { _numPrimitivesProperties++; }
5856
addProperty(&property, propertyIdentifier);
5957
return property;
6058
}
@@ -125,19 +123,16 @@ void PropertyContainer::updateTimestampOnLocallyChangedProperties()
125123
/* This function updates the timestamps on the primitive properties
126124
* that have been modified locally since last cloud synchronization
127125
*/
128-
if (_numPrimitivesProperties > 0)
129-
{
130-
std::for_each(_property_list.begin(),
131-
_property_list.end(),
132-
[](Property * p)
126+
std::for_each(_property_list.begin(),
127+
_property_list.end(),
128+
[](Property * p)
129+
{
130+
CloudWrapperBase * pbase = reinterpret_cast<CloudWrapperBase *>(p);
131+
if (pbase->isPrimitive() && pbase->isChangedLocally() && pbase->isReadableByCloud())
133132
{
134-
CloudWrapperBase * pbase = reinterpret_cast<CloudWrapperBase *>(p);
135-
if (pbase->isPrimitive() && pbase->isChangedLocally() && pbase->isReadableByCloud())
136-
{
137-
p->updateLocalTimestamp();
138-
}
139-
});
140-
}
133+
p->updateLocalTimestamp();
134+
}
135+
});
141136
}
142137

143138
/******************************************************************************

src/property/PropertyContainer.h

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class PropertyContainer
5858

5959
private:
6060

61-
int _numPrimitivesProperties;
6261
GetTimeCallbackFunc _get_time_func;
6362
std::list<Property *> _property_list;
6463

0 commit comments

Comments
 (0)