Switched to Google coding style to match cpplint expectations

This commit is contained in:
Benoit Blanchon
2014-10-23 23:13:13 +02:00
parent 5c8283b3e4
commit b43da1e421
47 changed files with 262 additions and 308 deletions

View File

@ -1,6 +1,6 @@
#include "ArduinoJson/JsonObject.hpp"
#include <string.h> // for strcmp
#include <string.h> // for strcmp
#include "ArduinoJson/JsonBuffer.hpp"
#include "ArduinoJson/JsonValue.hpp"
@ -28,8 +28,7 @@ void JsonObject::remove(char const *key) {
JsonArray JsonObject::createNestedArray(char const *key) {
JsonNode *node = getOrCreateNodeAt(key);
if (node)
node->setAsArray(_node->getContainerBuffer());
if (node) node->setAsArray(_node->getContainerBuffer());
return JsonArray(node);
}
@ -37,8 +36,7 @@ JsonArray JsonObject::createNestedArray(char const *key) {
JsonObject JsonObject::createNestedObject(char const *key) {
JsonNode *node = getOrCreateNodeAt(key);
if (node)
node->setAsObject(_node->getContainerBuffer());
if (node) node->setAsObject(_node->getContainerBuffer());
return JsonObject(node);
}
@ -47,17 +45,14 @@ JsonNode *JsonObject::getOrCreateNodeAt(const char *key) {
for (JsonNodeIterator it = beginChildren(); it != endChildren(); ++it) {
const char *childKey = it->getAsObjectKey();
if (!strcmp(childKey, key))
return it->getAsObjectValue();
if (!strcmp(childKey, key)) return it->getAsObjectValue();
}
JsonNode *newValueNode = createNode();
if (!newValueNode)
return 0;
if (!newValueNode) return 0;
JsonNode *newKeyNode = createNode();
if (!newKeyNode)
return 0;
if (!newKeyNode) return 0;
newKeyNode->setAsObjectKeyValue(key, newValueNode);