From 6eb06837c6fd36e2609c77838ec72288378d1dde Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Fri, 21 Feb 2020 23:40:26 +0800 Subject: [PATCH] Optimizations Using a faster method to read files. --- src/misc.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/misc.cpp b/src/misc.cpp index fb51136..0c7720a 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -689,7 +689,8 @@ std::string getMD5(const std::string &data) std::string fileGet(const std::string &path, bool binary, bool scope_limit) { std::ifstream infile; - std::stringstream strstrm; + //std::stringstream strstrm; + std::string content; std::ios::openmode mode = binary ? std::ios::binary : std::ios::in; if(scope_limit) @@ -706,11 +707,19 @@ std::string fileGet(const std::string &path, bool binary, bool scope_limit) infile.open(path, mode); if(infile) { - strstrm<