Ver Fonte

Merge pull request #791 from rmisev/patch-1

Optimize CivetServer::getPostData
bel2125 há 5 anos atrás
pai
commit
32299611c8
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/CivetServer.cpp

+ 1 - 1
src/CivetServer.cpp

@@ -584,7 +584,7 @@ CivetServer::getPostData(struct mg_connection *conn)
 	char buf[2048];
 	char buf[2048];
 	int r = mg_read(conn, buf, sizeof(buf));
 	int r = mg_read(conn, buf, sizeof(buf));
 	while (r > 0) {
 	while (r > 0) {
-		postdata += std::string(buf, r);
+		postdata.append(buf, r);
 		r = mg_read(conn, buf, sizeof(buf));
 		r = mg_read(conn, buf, sizeof(buf));
 	}
 	}
 	mg_unlock_connection(conn);
 	mg_unlock_connection(conn);