]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/utils.cpp
Include the matching header first in .cpp files
[libs/net.git] / source / http / utils.cpp
index 2f13576166ba9b128f0a111a1e507a8cb645fb96..8aa966cd09fc88a45092d46b4d37e72323beb9c3 100644 (file)
@@ -1,8 +1,8 @@
+#include "utils.h"
 #include <algorithm>
 #include <msp/strings/format.h>
 #include <msp/strings/regex.h>
 #include <msp/strings/utils.h>
-#include "utils.h"
 
 using namespace std;
 
@@ -31,6 +31,7 @@ namespace Http {
 string urlencode(const string &str, EncodeLevel level)
 {
        string result;
+       result.reserve(str.size());
        for(char c: str)
        {
                if(is_reserved(c, level))
@@ -44,6 +45,7 @@ string urlencode(const string &str, EncodeLevel level)
 string urlencode_plus(const string &str, EncodeLevel level)
 {
        string result;
+       result.reserve(str.size());
        for(char c: str)
        {
                if(c==' ')