ARMmbed / sockets

mbed sockets library abstraction layer
Other
6 stars 18 forks source link

Redundant error check in Socket class constructor #42

Closed adbridge closed 8 years ago

adbridge commented 8 years ago

In the constructor, the following code is redundant:

if (_socket.api == NULL) {
        error_check(SOCKET_ERROR_NULL_PTR);
    }

This is because error_check posts a Minor callback using the function stored in _onError, however at the point of construction this won't have been set and will still be NULL. Thus no callback will be registered anyway.

ciarmcom commented 8 years ago

ARM Internal Ref: IOTSFW-1424