Removed redundant range check in MemoryPoolPrint

This commit is contained in:
Benoit Blanchon committed 2021-04-18 16:47:28 +02:00
1 parent 2a777a659a
commit 64e52e97ee
2 files changed
+47 -19

No files matched your search

+2 -4
View File
@@ -215,10 +215,8 @@ class MemoryPoolPrint : public Print {
}
const char* c_str() {
if (_size >= _capacity)
return 0;
_string[_size++] = 0; // TODO: test overflow
_string[_size++] = 0;
ARDUINOJSON_ASSERT(_size <= _capacity);
return _pool->saveStringFromFreeZone(_size);
}