diff --git a/misc.cpp b/misc.cpp index 6f3a20cde..8169ab256 100644 --- a/misc.cpp +++ b/misc.cpp @@ -759,13 +759,6 @@ void shortDisassemble(int source, unsigned short &num_a, unsigned short &num_b) num_b = (unsigned short)(source >> 16); } -std::string to_string(const YAML::Node &node) -{ - std::stringstream ss; - ss << node; - return ss.str(); -} - int to_int(std::string &s, int def_vaule) { int retval = 0; diff --git a/misc.h b/misc.h index 9bb80b417..0c5d6f551 100644 --- a/misc.h +++ b/misc.h @@ -51,7 +51,6 @@ void urlParse(std::string url, std::string &host, std::string &path, int &port, void removeUTF8BOM(std::string &data); int shortAssemble(unsigned short num_a, unsigned short num_b); void shortDisassemble(int source, unsigned short &num_a, unsigned short &num_b); -std::string to_string(const YAML::Node &node); int to_int(std::string &s, int def_vaule = 0); std::string fileGet(std::string path, bool binary = true); diff --git a/subexport.cpp b/subexport.cpp index 2f658c795..3d424215b 100644 --- a/subexport.cpp +++ b/subexport.cpp @@ -585,7 +585,7 @@ std::string netchToClash(std::vector &nodes, std::string &base_conf, s rulesetToClash(yamlnode, ruleset_content_array); - return to_string(yamlnode); + return YAML::Dump(yamlnode); } std::string netchToSurge(std::vector &nodes, std::string &base_conf, std::vector &ruleset_content_array, string_array &extra_proxy_group, int surge_ver, extra_settings &ext) diff --git a/webserver_libevent.cpp b/webserver_libevent.cpp index 67811ede0..64ccca593 100644 --- a/webserver_libevent.cpp +++ b/webserver_libevent.cpp @@ -2,7 +2,9 @@ #include #include #include +#ifdef MALLOC_TRIM #include +#endif // MALLOC_TRIM #include #include