Преглед изворни кода

sdl2_sink: Inline variable init into if condition

Co-authored-by: Mai <mathew1800@gmail.com>
lat9nq пре 3 година
родитељ
комит
4b773b15a6
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      src/audio_core/sink/sdl2_sink.cpp

+ 1 - 2
src/audio_core/sink/sdl2_sink.cpp

@@ -230,8 +230,7 @@ std::vector<std::string> 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);
         }
     }