diff --git a/pixivclient.cpp b/pixivclient.cpp index f14172d..85a6700 100644 --- a/pixivclient.cpp +++ b/pixivclient.cpp @@ -9,7 +9,6 @@ using namespace std::string_literals; static const constexpr char* touch_user_agent = "Mozilla/5.0 (Android 12; Mobile; rv:97.0) Gecko/97.0 Firefox/97.0"; static const constexpr char* desktop_user_agent = "Mozilla/5.0 (Windows NT 10.0; rv:111.0) Gecko/20100101 Firefox/111.0"; -static void to_lower(std::string& str); PixivClient::PixivClient(Redis* redis) : _redis(redis) { this->_www_pixiv_net_client.set_keep_alive(true); @@ -46,7 +45,6 @@ Illust PixivClient::get_illust(uint64_t illust_id) { } SearchResults PixivClient::search_illusts(std::string query, size_t page, const std::string& order) { - to_lower(query); httplib::Params params = { {"lang", "en"}, {"mode", "all"}, @@ -64,7 +62,6 @@ SearchResults PixivClient::search_illusts(std::string query, size_t page, const } std::vector PixivClient::get_search_suggestions(std::string query) { - to_lower(query); std::string body = [&]() { std::string cache_key = "pixwhile:searchsugg:"s + std::to_string(FastHash(query.data(), query.size(), 0)); if (this->_redis) { @@ -142,12 +139,3 @@ bool PixivClient::i_pximg_url_valid(const std::string& path) { } return res->status >= 200 && res->status <= 200; } - - -static void to_lower(std::string& str) { - for (size_t i = 0; i < str.size(); i++) { - if (str[i] >= 'A' && str[i] <= 'Z') { - str[i] = static_cast(str[i] - 'A' + 'a'); - } - } -}