Skip to content

Commit 1138f43

Browse files
committed
few cosmetic changes
1 parent a02eeb6 commit 1138f43

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎JSON/include/Poco/JSON/Array.h‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,8 @@ class JSON_API Array
134134
return value;
135135
}
136136

137-
void add(const Dynamic::Var& value)
137+
void add(const Dynamic::Var& value);
138138
/// Add the given value to the array
139-
{
140-
_values.push_back(value);
141-
}
142139

143140
void stringify(std::ostream& out, unsigned int indent) const;
144141
/// Prints the array to out. When indent is 0, the array
@@ -178,14 +175,9 @@ inline bool Array::isArray(unsigned int index) const
178175
}
179176

180177

181-
inline bool Array::isNull(unsigned int index) const
178+
inline void Array::add(const Dynamic::Var& value)
182179
{
183-
if ( index < _values.size() )
184-
{
185-
Dynamic::Var value = _values[index];
186-
return value.isEmpty();
187-
}
188-
return true;
180+
_values.push_back(value);
189181
}
190182

191183

‎JSON/include/Poco/JSON/Object.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ class JSON_API Object
118118
{
119119
T value = def;
120120
ValueMap::const_iterator it = _values.find(key);
121-
if ( it != _values.end()
122-
&& ! it->second.isEmpty() )
121+
if (it != _values.end() && ! it->second.isEmpty() )
123122
{
124123
try
125124
{

‎JSON/src/Array.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ Object::Ptr Array::getObject(unsigned int index) const
102102
}
103103

104104

105+
bool Array::isNull(unsigned int index) const
106+
{
107+
if ( index < _values.size() )
108+
{
109+
Dynamic::Var value = _values[index];
110+
return value.isEmpty();
111+
}
112+
return true;
113+
}
114+
115+
105116
bool Array::isObject(unsigned int index) const
106117
{
107118
Var value = get(index);

0 commit comments

Comments
 (0)