Skip to content

Commit 9d3f3c9

Browse files
committed
fix
1 parent 2b7b1aa commit 9d3f3c9

File tree

1 file changed

+3
-65
lines changed

1 file changed

+3
-65
lines changed

include/cppredis/cpp_redis_request.hpp

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ namespace cpp_redis {
345345
{
346346
auto key_cmds = std::move(cmds);
347347
BYTES v;
348-
add_number(get_command_size(key_cmds), v, '*');
348+
add_number(get_commands(key_cmds), v, '*');
349349
add_value_with_size(command, v);
350350

351351
for (auto i = key_cmds.begin(); i != key_cmds.end(); ++i) {
@@ -357,75 +357,13 @@ namespace cpp_redis {
357357
return std::move(v);
358358
}
359359

360-
template <class T>
361-
PAIR make_pair(T&& key, std::string&& value)
362-
{
363-
PAIR u;
364-
u.first = std::move(key);
365-
u.second = std::move(value);
366-
return std::move(u);
367-
}
368-
369-
template <class T>
370-
PAIR make_pair(T&& key, const char* value)
371-
{
372-
PAIR u;
373-
u.first = std::move(key);
374-
u.second = std::move(std::string(value, strlen(value)));
375-
return std::move(u);
376-
}
377-
378-
template <class T>
379-
PAIR make_pair(T&& key, const unsigned char* value, size_t length)
380-
{
381-
PAIR u;
382-
u.first = std::move(key);
383-
u.second = std::move(std::string(value, length));
384-
return std::move(u);
385-
}
386-
387-
template <class T>
388-
PAIR make_pair(T&& key, const std::int32_t value)
389-
{
390-
std::stringstream str;
391-
str << value;
392-
return std::move(make_pair(std::move(key), str.str()));
393-
}
394-
395-
template <class T>
396-
PAIR make_pair(T&& key, const std::uint32_t value)
397-
{
398-
std::stringstream str;
399-
str << value;
400-
return std::move(make_pair(std::move(key), str.str()));
401-
}
402-
403-
template<class T>
404-
void make_pairs(PAIR&& cmd, T& p)
405-
{
406-
if (cmd.first.empty()) {
407-
return;
408-
}
409-
410-
p.push_back(std::move(cmd));
411-
}
412-
413-
void makePairs(PAIR&& cmd, std::map<KEY, BYTES>& p)
414-
{
415-
if (cmd.first.empty()) {
416-
return;
417-
}
418-
419-
p.insert(std::move(cmd));
420-
}
421-
422360
template<typename T>
423-
int get_command_size(const T& cmds)
361+
int get_commands(const T& cmds)
424362
{
425363
return cmds.size() + 1;
426364
}
427365

428-
int get_command_size(const PAIRS& cmds)
366+
int get_commands(const PAIRS& cmds)
429367
{
430368
return cmds.size() * 2 + 1;
431369
}

0 commit comments

Comments
 (0)