From fb32b5527b69fddbfe61aa5960d2815d843fd9e2 Mon Sep 17 00:00:00 2001 From: Ricard Rovira Cubeles Date: Tue, 22 Oct 2024 17:19:46 +0200 Subject: [PATCH] Use somewhat more performant and idiomatic versions of string substitution --- addons/com.heroiclabs.nakama/Satori/SatoriAPI.gd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/com.heroiclabs.nakama/Satori/SatoriAPI.gd b/addons/com.heroiclabs.nakama/Satori/SatoriAPI.gd index 21aee34..d3e2a35 100644 --- a/addons/com.heroiclabs.nakama/Satori/SatoriAPI.gd +++ b/addons/com.heroiclabs.nakama/Satori/SatoriAPI.gd @@ -1300,8 +1300,7 @@ class ApiClient extends RefCounted: if try_refresh.is_exception(): return SatoriAsyncResult.new(try_refresh.get_exception()) await p_session.refresh(try_refresh) - var urlpath : String = "/v1/message/{id}" - urlpath = urlpath.replace("{id}", SatoriSerializer.escape_http(p_id)) + var urlpath : String = "/v1/message/%s" % SatoriSerializer.escape_http(p_id) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "DELETE" @@ -1327,8 +1326,7 @@ class ApiClient extends RefCounted: if try_refresh.is_exception(): return SatoriAsyncResult.new(try_refresh.get_exception()) await p_session.refresh(try_refresh) - var urlpath : String = "/v1/message/{id}" - urlpath = urlpath.replace("{id}", SatoriSerializer.escape_http(p_id)) + var urlpath : String = "/v1/message/%s" % SatoriSerializer.escape_http(p_id) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "PUT"