thestk / rtaudio

A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO, and WASAPI) operating systems.
Other
1.49k stars 317 forks source link

Remove unnecessary null pointer checks #387

Closed elfring closed 1 year ago

elfring commented 1 year ago

An extra null pointer check is not needed in functions like the following.

garyscavone commented 1 year ago

ASIOInit is a function in the ASIO API ... I'm not changing that. It is true that as currently used, the check in RtAudio::openRtApi() is not necessary. However, the code could be changed in the future such that openRtApi() is called from another function (not just the constructor) and there might be an instance of rtapi allocated. So, I don't see the harm in leaving it as is.