Browse Source

Remove string splitting

Nico Chatzi 5 years ago
parent
commit
b8ef343de3
1 changed files with 1 additions and 19 deletions
  1. 1 19
      test/p2p/offerer.cpp

+ 1 - 19
test/p2p/offerer.cpp

@@ -59,22 +59,6 @@ std::string base64_encode(const std::string & in) {
   return out;
 }
 
-std::vector<string> split(const string& str, const string& delim)
-{
-    vector<string> tokens;
-    size_t prev = 0, pos = 0;
-    do
-    {
-        pos = str.find(delim, prev);
-        if (pos == string::npos) pos = str.length();
-        string token = str.substr(prev, pos-prev);
-        if (!token.empty()) tokens.push_back(token);
-        prev = pos + delim.length();
-    }
-    while (pos < str.length() && prev < str.length());
-    return tokens;
-}
-
 int main(int argc, char **argv) {
 	InitLogger(LogLevel::Warning);
 
@@ -116,9 +100,7 @@ int main(int argc, char **argv) {
 			res = cli.Get("/state/json");
 		}
 
-		std::string description;
-		auto parts = split(res->body, "xxxxx");
-		pc->setRemoteDescription(parts[0]);
+		pc->setRemoteDescription(res->body);
 	});
 
 	pc->onStateChange([wpc = make_weak_ptr(pc)](PeerConnection::State state){