From fc28e5142593e69a960ab8dd72ff88a2f06065da Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Tue, 1 Oct 2024 14:14:10 -0400 Subject: Improve c++ http api performance --- http.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'http.h') diff --git a/http.h b/http.h index 6edb801a..83b898a9 100644 --- a/http.h +++ b/http.h @@ -207,7 +207,7 @@ namespace BinaryNinja::Http \param downloadProgress Function to call for download progress updates \param uploadProgress Function to call for upload progress updates */ - Request(_STD_STRING method, _STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers = {}, + Request(_STD_STRING method, _STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers = {}, _STD_VECTOR> params = {}, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -223,7 +223,7 @@ namespace BinaryNinja::Http \param downloadProgress Function to call for download progress updates \param uploadProgress Function to call for upload progress updates */ - Request(_STD_STRING method, _STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers, + Request(_STD_STRING method, _STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers, _STD_VECTOR> params, _STD_VECTOR body, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -239,7 +239,7 @@ namespace BinaryNinja::Http \param downloadProgress Function to call for download progress updates \param uploadProgress Function to call for upload progress updates */ - Request(_STD_STRING method, _STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers, + Request(_STD_STRING method, _STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers, _STD_VECTOR> params, _STD_VECTOR> formFields, std::function downloadProgress = {}, @@ -256,7 +256,7 @@ namespace BinaryNinja::Http \param downloadProgress Function to call for download progress updates \param uploadProgress Function to call for upload progress updates */ - Request(_STD_STRING method, _STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers, + Request(_STD_STRING method, _STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers, _STD_VECTOR> params, _STD_VECTOR formFields, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -271,8 +271,8 @@ namespace BinaryNinja::Http \param uploadProgress Function to call for upload progress updates \return Request structure with specified fields */ - static Request Get(_STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers = {}, - _STD_VECTOR> params = {}, + static Request Get(_STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers = {}, + const _STD_VECTOR>& params = {}, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -287,8 +287,8 @@ namespace BinaryNinja::Http \param uploadProgress Function to call for upload progress updates \return Request structure with specified fields */ - static Request Post(_STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers = {}, - _STD_VECTOR> params = {}, _STD_VECTOR body = {}, + static Request Post(_STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers = {}, + const _STD_VECTOR>& params = {}, const _STD_VECTOR& body = {}, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -303,9 +303,9 @@ namespace BinaryNinja::Http \param uploadProgress Function to call for upload progress updates \return Request structure with specified fields */ - static Request Post(_STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers, - _STD_VECTOR> params, - _STD_VECTOR> formFields, + static Request Post(_STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers, + const _STD_VECTOR>& params, + const _STD_VECTOR>& formFields, std::function downloadProgress = {}, std::function uploadProgress = {}); @@ -320,8 +320,8 @@ namespace BinaryNinja::Http \param uploadProgress Function to call for upload progress updates \return Request structure with specified fields */ - static Request Post(_STD_STRING url, _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING> headers, - _STD_VECTOR> params, _STD_VECTOR formFields, + static Request Post(_STD_STRING url, const _STD_UNORDERED_MAP<_STD_STRING, _STD_STRING>& headers, + const _STD_VECTOR>& params, const _STD_VECTOR& formFields, std::function downloadProgress = {}, std::function uploadProgress = {}); }; -- cgit v1.3.1