Skip to content

Commit bb3a88e

Browse files
author
Seppo Takalo
committed
Remove unceressary NULL check from BufferedBlockDevice::size()
1 parent f08a451 commit bb3a88e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

features/storage/blockdevice/BufferedBlockDevice.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ BufferedBlockDevice::BufferedBlockDevice(BlockDevice *bd)
3131
: _bd(bd), _bd_program_size(0), _bd_read_size(0), _bd_size(0), _write_cache_addr(0), _write_cache_valid(false),
3232
_write_cache(0), _read_buf(0), _init_ref_count(0), _is_initialized(false)
3333
{
34+
MBED_ASSERT(_bd);
3435
}
3536

3637
BufferedBlockDevice::~BufferedBlockDevice()
@@ -332,11 +333,7 @@ bd_size_t BufferedBlockDevice::size() const
332333

333334
const char *BufferedBlockDevice::get_type() const
334335
{
335-
if (_bd != NULL) {
336-
return _bd->get_type();
337-
}
338-
339-
return NULL;
336+
return _bd->get_type();
340337
}
341338

342339
} // namespace mbed

0 commit comments

Comments
 (0)