diff options
| author | garder500 <jeremy27.clara22@gmail.com> | 2025-05-02 00:10:43 +0200 |
|---|---|---|
| committer | garder500 <jeremy27.clara22@gmail.com> | 2025-05-02 00:10:43 +0200 |
| commit | 83298ee3aec687ba1c5f41fb7135e465869d4fe8 (patch) | |
| tree | d4d54cd1f1cb8d6e355fee138cf0d460dd4b1b6f /bot/include/utils.hpp | |
| parent | fe156854748a767aafc773748e1c4ecc9a701484 (diff) | |
Refactor la gestion des traductions : remplacement des maps par des unordered_maps pour améliorer les performances dans la fonction translate.
Diffstat (limited to 'bot/include/utils.hpp')
| -rw-r--r-- | bot/include/utils.hpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bot/include/utils.hpp b/bot/include/utils.hpp index b0482dd..7008dec 100644 --- a/bot/include/utils.hpp +++ b/bot/include/utils.hpp @@ -1,7 +1,5 @@ // utils.hpp #pragma once -#ifndef UTILS_HPP -#define UTILS_HPP #include <dpp/dpp.h> #include <dpp/nlohmann/json.hpp> @@ -103,10 +101,9 @@ namespace app * @param args The optional parameters to replace in the string * @return std::string The translated string */ - std::string translate(const std::string &str, const std::string &locale, const std::map<Lang, std::map<std::string, std::string>> &array_translations, const std::unordered_map<std::string, std::string> &args = {}); + std::string translate(const std::string &str, const std::string &locale, const std::unordered_map<Lang, std::unordered_map<std::string, std::string>> &array_translations, const std::unordered_map<std::string, std::string> &args = {}); } // namespace dpp -#endif // UTILS_HPP // utils.hpp |
