From 0f5455230c8955be0c6533574bd3d5b6f50792b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 15 Feb 2022 18:06:48 +0100 Subject: Use `switch` consistently in `_notification` (`scene` folder) --- scene/main/http_request.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'scene/main/http_request.cpp') diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 4e91548d14..700ba761f6 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -464,20 +464,22 @@ void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArra } void HTTPRequest::_notification(int p_what) { - if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (use_threads.is_set()) { - return; - } - bool done = _update_connection(); - if (done) { - set_process_internal(false); - } - } + switch (p_what) { + case NOTIFICATION_INTERNAL_PROCESS: { + if (use_threads.is_set()) { + return; + } + bool done = _update_connection(); + if (done) { + set_process_internal(false); + } + } break; - if (p_what == NOTIFICATION_EXIT_TREE) { - if (requesting) { - cancel_request(); - } + case NOTIFICATION_EXIT_TREE: { + if (requesting) { + cancel_request(); + } + } break; } } -- cgit v1.2.3