Skip to content

Commit 825c3fb

Browse files
committed
Removed excess usage of std::move
1 parent 00bdf73 commit 825c3fb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

httplib.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ using ssize_t = long;
145145
#endif // _MSC_VER
146146

147147
#ifndef S_ISREG
148-
#define S_ISREG(m) (((m)&S_IFREG) == S_IFREG)
148+
#define S_ISREG(m) (((m) & S_IFREG) == S_IFREG)
149149
#endif // S_ISREG
150150

151151
#ifndef S_ISDIR
152-
#define S_ISDIR(m) (((m)&S_IFDIR) == S_IFDIR)
152+
#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
153153
#endif // S_ISDIR
154154

155155
#ifndef NOMINMAX
@@ -719,7 +719,7 @@ class ThreadPool final : public TaskQueue {
719719

720720
if (pool_.shutdown_ && pool_.jobs_.empty()) { break; }
721721

722-
fn = std::move(pool_.jobs_.front());
722+
fn = pool_.jobs_.front();
723723
pool_.jobs_.pop_front();
724724
}
725725

@@ -3809,7 +3809,7 @@ inline bool parse_header(const char *beg, const char *end, T fn) {
38093809
auto val = compare_case_ignore(key, "Location")
38103810
? std::string(p, end)
38113811
: decode_url(std::string(p, end), false);
3812-
fn(std::move(key), std::move(val));
3812+
fn(key, val);
38133813
return true;
38143814
}
38153815

@@ -3847,8 +3847,8 @@ inline bool read_headers(Stream &strm, Headers &headers) {
38473847
auto end = line_reader.ptr() + line_reader.size() - line_terminator_len;
38483848

38493849
parse_header(line_reader.ptr(), end,
3850-
[&](std::string &&key, std::string &&val) {
3851-
headers.emplace(std::move(key), std::move(val));
3850+
[&](const std::string &key, const std::string &val) {
3851+
headers.emplace(key, val);
38523852
});
38533853
}
38543854

@@ -3948,8 +3948,8 @@ inline bool read_content_chunked(Stream &strm, T &x,
39483948
auto end = line_reader.ptr() + line_reader.size() - line_terminator_len;
39493949

39503950
parse_header(line_reader.ptr(), end,
3951-
[&](std::string &&key, std::string &&val) {
3952-
x.headers.emplace(std::move(key), std::move(val));
3951+
[&](const std::string &key, const std::string &val) {
3952+
x.headers.emplace(key, val);
39533953
});
39543954

39553955
if (!line_reader.getline()) { return false; }
@@ -4461,7 +4461,7 @@ class MultipartFormDataParser {
44614461
const auto header = buf_head(pos);
44624462

44634463
if (!parse_header(header.data(), header.data() + header.size(),
4464-
[&](std::string &&, std::string &&) {})) {
4464+
[&](const std::string &, const std::string &) {})) {
44654465
is_valid_ = false;
44664466
return false;
44674467
}

0 commit comments

Comments
 (0)