Skip to content

Commit 0dc653f

Browse files
committed
Fix redundant Progress copy in Get methods
1 parent 7a58c0a commit 0dc653f

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

httplib.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3726,8 +3726,7 @@ inline bool Client::process_and_close_socket(
37263726
inline bool Client::is_ssl() const { return false; }
37273727

37283728
inline std::shared_ptr<Response> Client::Get(const char *path) {
3729-
Progress dummy;
3730-
return Get(path, Headers(), dummy);
3729+
return Get(path, Headers(), Progress());
37313730
}
37323731

37333732
inline std::shared_ptr<Response> Client::Get(const char *path,
@@ -3737,8 +3736,7 @@ inline std::shared_ptr<Response> Client::Get(const char *path,
37373736

37383737
inline std::shared_ptr<Response> Client::Get(const char *path,
37393738
const Headers &headers) {
3740-
Progress dummy;
3741-
return Get(path, headers, dummy);
3739+
return Get(path, headers, Progress());
37423740
}
37433741

37443742
inline std::shared_ptr<Response>
@@ -3755,37 +3753,33 @@ Client::Get(const char *path, const Headers &headers, Progress progress) {
37553753

37563754
inline std::shared_ptr<Response> Client::Get(const char *path,
37573755
ContentReceiver content_receiver) {
3758-
Progress dummy;
3759-
return Get(path, Headers(), nullptr, std::move(content_receiver), dummy);
3756+
return Get(path, Headers(), nullptr, std::move(content_receiver), Progress());
37603757
}
37613758

37623759
inline std::shared_ptr<Response> Client::Get(const char *path,
37633760
ContentReceiver content_receiver,
37643761
Progress progress) {
3765-
return Get(path, Headers(), nullptr, std::move(content_receiver), progress);
3762+
return Get(path, Headers(), nullptr, std::move(content_receiver), std::move(progress));
37663763
}
37673764

37683765
inline std::shared_ptr<Response> Client::Get(const char *path,
37693766
const Headers &headers,
37703767
ContentReceiver content_receiver) {
3771-
Progress dummy;
3772-
return Get(path, headers, nullptr, std::move(content_receiver), dummy);
3768+
return Get(path, headers, nullptr, std::move(content_receiver), Progress());
37733769
}
37743770

37753771
inline std::shared_ptr<Response> Client::Get(const char *path,
37763772
const Headers &headers,
37773773
ContentReceiver content_receiver,
37783774
Progress progress) {
3779-
return Get(path, headers, nullptr, std::move(content_receiver), progress);
3775+
return Get(path, headers, nullptr, std::move(content_receiver), std::move(progress));
37803776
}
37813777

37823778
inline std::shared_ptr<Response> Client::Get(const char *path,
37833779
const Headers &headers,
37843780
ResponseHandler response_handler,
37853781
ContentReceiver content_receiver) {
3786-
Progress dummy;
3787-
return Get(path, headers, std::move(response_handler), content_receiver,
3788-
dummy);
3782+
return Get(path, headers, std::move(response_handler), content_receiver, Progress());
37893783
}
37903784

37913785
inline std::shared_ptr<Response> Client::Get(const char *path,

0 commit comments

Comments
 (0)