Skip to content

Commit 0aded2a

Browse files
committed
Reduced code size
1 parent 1b5be89 commit 0aded2a

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

include/ArduinoJson/Internals/JsonBufferAllocated.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace Internals {
1414
class JsonBufferAllocated {
1515
public:
1616
void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() {
17+
if (!jsonBuffer) return NULL;
1718
return jsonBuffer->alloc(n);
1819
}
1920

include/ArduinoJson/JsonVariantBase.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class JsonVariantBase {
7979
FORCE_INLINE const JsonObjectSubscript operator[](const char *key) const;
8080
FORCE_INLINE const JsonObjectSubscript operator[](const String &key) const;
8181

82-
protected:
83-
JsonVariantBase() {}
84-
8582
private:
8683
const TImpl *impl() const { return static_cast<const TImpl *>(this); }
8784
};

src/Internals/List.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ size_t List<T>::size() const {
2121

2222
template <typename T>
2323
typename List<T>::node_type *List<T>::addNewNode() {
24-
if (!_buffer) return NULL;
25-
2624
node_type *newNode = new (_buffer) node_type();
2725

2826
if (_firstNode) {

0 commit comments

Comments
 (0)