Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
Fix compile error on MacOS.
Speed up generation of Clash configuration.
  • Loading branch information
tindy2013 committed Dec 3, 2019
1 parent 1052fb3 commit 4057d7e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
7 changes: 0 additions & 7 deletions misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ std::string netchToClash(std::vector<nodeInfo> &nodes, std::string &base_conf, s

rulesetToClash(yamlnode, ruleset_content_array);

return to_string(yamlnode);
return YAML::Dump(yamlnode);
}

std::string netchToSurge(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, int surge_ver, extra_settings &ext)
Expand Down
2 changes: 2 additions & 0 deletions webserver_libevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include <cstdint>
#include <iostream>
#include <evhttp.h>
#ifdef MALLOC_TRIM
#include <malloc.h>
#endif // MALLOC_TRIM

#include <string>
#include <vector>
Expand Down

0 comments on commit 4057d7e

Please sign in to comment.