From 4b773b15a6cb7d78d7a9d71cf0f73fb5af591cba Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 16 Oct 2022 20:37:11 -0400 Subject: sdl2_sink: Inline variable init into if condition Co-authored-by: Mai --- src/audio_core/sink/sdl2_sink.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/audio_core/sink/sdl2_sink.cpp') diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index cc13c6254..c138dc628 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -230,8 +230,7 @@ std::vector ListSDLSinkDevices(bool capture) { const int device_count = SDL_GetNumAudioDevices(capture); for (int i = 0; i < device_count; ++i) { - const char* name = SDL_GetAudioDeviceName(i, capture); - if (name != nullptr) { + if (const char* name = SDL_GetAudioDeviceName(i, capture)) { device_list.emplace_back(name); } } -- cgit v1.2.3