mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
chore: eliminate most of clang++ warnings (#2288)
Not all of them but 90% is done. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
dc3bc9e92f
commit
d88b2422de
30 changed files with 159 additions and 144 deletions
20
.devcontainer/alpine/devcontainer.json
Normal file
20
.devcontainer/alpine/devcontainer.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "helio",
|
||||
"image": "ghcr.io/romange/alpine-dev",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-vscode.cpptools-themes",
|
||||
"twxs.cmake"
|
||||
],
|
||||
"settings": {
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build-alpine"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"source=alpine-vol,target=/root,type=volume"
|
||||
]
|
||||
}
|
|
@ -23,7 +23,7 @@ AstRangeNode::AstRangeNode(double lo, bool lo_excl, double hi, bool hi_excl)
|
|||
: lo{lo_excl ? nextafter(lo, hi) : lo}, hi{hi_excl ? nextafter(hi, lo) : hi} {
|
||||
}
|
||||
|
||||
AstNegateNode::AstNegateNode(AstNode&& node) : node{make_unique<AstNode>(move(node))} {
|
||||
AstNegateNode::AstNegateNode(AstNode&& node) : node{make_unique<AstNode>(std::move(node))} {
|
||||
}
|
||||
|
||||
AstLogicalNode::AstLogicalNode(AstNode&& l, AstNode&& r, LogicOp op) : op{op}, nodes{} {
|
||||
|
@ -31,30 +31,30 @@ AstLogicalNode::AstLogicalNode(AstNode&& l, AstNode&& r, LogicOp op) : op{op}, n
|
|||
// we can re-use it, as logical ops are associative.
|
||||
for (auto* node : {&l, &r}) {
|
||||
if (auto* ln = get_if<AstLogicalNode>(node); ln && ln->op == op) {
|
||||
*this = move(*ln);
|
||||
nodes.emplace_back(move(*(node == &l ? &r : &l)));
|
||||
*this = std::move(*ln);
|
||||
nodes.emplace_back(std::move(*(node == &l ? &r : &l)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nodes.emplace_back(move(l));
|
||||
nodes.emplace_back(move(r));
|
||||
nodes.emplace_back(std::move(l));
|
||||
nodes.emplace_back(std::move(r));
|
||||
}
|
||||
|
||||
AstFieldNode::AstFieldNode(string field, AstNode&& node)
|
||||
: field{field.substr(1)}, node{make_unique<AstNode>(move(node))} {
|
||||
: field{field.substr(1)}, node{make_unique<AstNode>(std::move(node))} {
|
||||
}
|
||||
|
||||
AstTagsNode::AstTagsNode(std::string tag) {
|
||||
tags = {move(tag)};
|
||||
tags = {std::move(tag)};
|
||||
}
|
||||
|
||||
AstTagsNode::AstTagsNode(AstExpr&& l, std::string tag) {
|
||||
DCHECK(holds_alternative<AstTagsNode>(l));
|
||||
auto& tags_node = get<AstTagsNode>(l);
|
||||
|
||||
tags = move(tags_node.tags);
|
||||
tags.push_back(move(tag));
|
||||
tags = std::move(tags_node.tags);
|
||||
tags.push_back(std::move(tag));
|
||||
}
|
||||
|
||||
AstKnnNode::AstKnnNode(uint32_t limit, std::string_view field, OwnedFtVector vec,
|
||||
|
|
|
@ -88,49 +88,49 @@ using namespace std;
|
|||
|
||||
final_query:
|
||||
filter
|
||||
{ driver->Set(move($1)); }
|
||||
{ driver->Set(std::move($1)); }
|
||||
| filter ARROW knn_query
|
||||
{ driver->Set(AstKnnNode(move($1), move($3))); }
|
||||
{ driver->Set(AstKnnNode(std::move($1), std::move($3))); }
|
||||
|
||||
knn_query:
|
||||
LBRACKET KNN UINT32 FIELD TERM opt_knn_alias RBRACKET
|
||||
{ $$ = AstKnnNode($3, $4, BytesToFtVector($5), $6); }
|
||||
|
||||
opt_knn_alias:
|
||||
AS TERM { $$ = move($2); }
|
||||
AS TERM { $$ = std::move($2); }
|
||||
| { $$ = std::string{}; }
|
||||
|
||||
filter:
|
||||
search_expr { $$ = move($1); }
|
||||
search_expr { $$ = std::move($1); }
|
||||
| STAR { $$ = AstStarNode(); }
|
||||
|
||||
search_expr:
|
||||
search_unary_expr { $$ = move($1); }
|
||||
| search_and_expr { $$ = move($1); }
|
||||
| search_or_expr { $$ = move($1); }
|
||||
search_unary_expr { $$ = std::move($1); }
|
||||
| search_and_expr { $$ = std::move($1); }
|
||||
| search_or_expr { $$ = std::move($1); }
|
||||
|
||||
search_and_expr:
|
||||
search_unary_expr search_unary_expr %prec AND_OP { $$ = AstLogicalNode(move($1), move($2), AstLogicalNode::AND); }
|
||||
| search_and_expr search_unary_expr %prec AND_OP { $$ = AstLogicalNode(move($1), move($2), AstLogicalNode::AND); }
|
||||
search_unary_expr search_unary_expr %prec AND_OP { $$ = AstLogicalNode(std::move($1), std::move($2), AstLogicalNode::AND); }
|
||||
| search_and_expr search_unary_expr %prec AND_OP { $$ = AstLogicalNode(std::move($1), std::move($2), AstLogicalNode::AND); }
|
||||
|
||||
search_or_expr:
|
||||
search_expr OR_OP search_and_expr { $$ = AstLogicalNode(move($1), move($3), AstLogicalNode::OR); }
|
||||
| search_expr OR_OP search_unary_expr { $$ = AstLogicalNode(move($1), move($3), AstLogicalNode::OR); }
|
||||
search_expr OR_OP search_and_expr { $$ = AstLogicalNode(std::move($1), std::move($3), AstLogicalNode::OR); }
|
||||
| search_expr OR_OP search_unary_expr { $$ = AstLogicalNode(std::move($1), std::move($3), AstLogicalNode::OR); }
|
||||
|
||||
search_unary_expr:
|
||||
LPAREN search_expr RPAREN { $$ = move($2); }
|
||||
| NOT_OP search_unary_expr { $$ = AstNegateNode(move($2)); }
|
||||
| TERM { $$ = AstTermNode(move($1)); }
|
||||
LPAREN search_expr RPAREN { $$ = std::move($2); }
|
||||
| NOT_OP search_unary_expr { $$ = AstNegateNode(std::move($2)); }
|
||||
| TERM { $$ = AstTermNode(std::move($1)); }
|
||||
| UINT32 { $$ = AstTermNode(to_string($1)); }
|
||||
| FIELD COLON field_cond { $$ = AstFieldNode(move($1), move($3)); }
|
||||
| FIELD COLON field_cond { $$ = AstFieldNode(std::move($1), std::move($3)); }
|
||||
|
||||
field_cond:
|
||||
TERM { $$ = AstTermNode(move($1)); }
|
||||
TERM { $$ = AstTermNode(std::move($1)); }
|
||||
| UINT32 { $$ = AstTermNode(to_string($1)); }
|
||||
| NOT_OP field_cond { $$ = AstNegateNode(move($2)); }
|
||||
| LPAREN field_cond_expr RPAREN { $$ = move($2); }
|
||||
| LBRACKET numeric_filter_expr RBRACKET { $$ = move($2); }
|
||||
| LCURLBR tag_list RCURLBR { $$ = move($2); }
|
||||
| NOT_OP field_cond { $$ = AstNegateNode(std::move($2)); }
|
||||
| LPAREN field_cond_expr RPAREN { $$ = std::move($2); }
|
||||
| LBRACKET numeric_filter_expr RBRACKET { $$ = std::move($2); }
|
||||
| LCURLBR tag_list RCURLBR { $$ = std::move($2); }
|
||||
|
||||
numeric_filter_expr:
|
||||
opt_lparen generic_number opt_lparen generic_number { $$ = AstRangeNode($2, $1, $4, $3); }
|
||||
|
@ -144,29 +144,29 @@ opt_lparen:
|
|||
| LPAREN { $$ = true; }
|
||||
|
||||
field_cond_expr:
|
||||
field_unary_expr { $$ = move($1); }
|
||||
| field_and_expr { $$ = move($1); }
|
||||
| field_or_expr { $$ = move($1); }
|
||||
field_unary_expr { $$ = std::move($1); }
|
||||
| field_and_expr { $$ = std::move($1); }
|
||||
| field_or_expr { $$ = std::move($1); }
|
||||
|
||||
field_and_expr:
|
||||
field_unary_expr field_unary_expr %prec AND_OP { $$ = AstLogicalNode(move($1), move($2), AstLogicalNode::AND); }
|
||||
| field_and_expr field_unary_expr %prec AND_OP { $$ = AstLogicalNode(move($1), move($2), AstLogicalNode::AND); }
|
||||
field_unary_expr field_unary_expr %prec AND_OP { $$ = AstLogicalNode(std::move($1), std::move($2), AstLogicalNode::AND); }
|
||||
| field_and_expr field_unary_expr %prec AND_OP { $$ = AstLogicalNode(std::move($1), std::move($2), AstLogicalNode::AND); }
|
||||
|
||||
field_or_expr:
|
||||
field_cond_expr OR_OP field_unary_expr { $$ = AstLogicalNode(move($1), move($3), AstLogicalNode::OR); }
|
||||
| field_cond_expr OR_OP field_and_expr { $$ = AstLogicalNode(move($1), move($3), AstLogicalNode::OR); }
|
||||
field_cond_expr OR_OP field_unary_expr { $$ = AstLogicalNode(std::move($1), std::move($3), AstLogicalNode::OR); }
|
||||
| field_cond_expr OR_OP field_and_expr { $$ = AstLogicalNode(std::move($1), std::move($3), AstLogicalNode::OR); }
|
||||
|
||||
field_unary_expr:
|
||||
LPAREN field_cond_expr RPAREN { $$ = move($2); }
|
||||
| NOT_OP field_unary_expr { $$ = AstNegateNode(move($2)); };
|
||||
| TERM { $$ = AstTermNode(move($1)); }
|
||||
LPAREN field_cond_expr RPAREN { $$ = std::move($2); }
|
||||
| NOT_OP field_unary_expr { $$ = AstNegateNode(std::move($2)); };
|
||||
| TERM { $$ = AstTermNode(std::move($1)); }
|
||||
| UINT32 { $$ = AstTermNode(to_string($1)); }
|
||||
|
||||
tag_list:
|
||||
TERM { $$ = AstTagsNode(move($1)); }
|
||||
TERM { $$ = AstTagsNode(std::move($1)); }
|
||||
| UINT32 { $$ = AstTagsNode(to_string($1)); }
|
||||
| tag_list OR_OP TERM { $$ = AstTagsNode(move($1), move($3)); }
|
||||
| tag_list OR_OP DOUBLE { $$ = AstTagsNode(move($1), to_string($3)); }
|
||||
| tag_list OR_OP TERM { $$ = AstTagsNode(std::move($1), std::move($3)); }
|
||||
| tag_list OR_OP DOUBLE { $$ = AstTagsNode(std::move($1), to_string($3)); }
|
||||
|
||||
|
||||
%%
|
||||
|
|
|
@ -55,7 +55,7 @@ struct IndexResult {
|
|||
value_ = DocVec{};
|
||||
}
|
||||
|
||||
IndexResult(DocVec&& dv) : value_{move(dv)} {
|
||||
IndexResult(DocVec&& dv) : value_{std::move(dv)} {
|
||||
}
|
||||
|
||||
IndexResult(const DocVec* dv) : value_{dv} {
|
||||
|
@ -224,7 +224,7 @@ struct BasicSearch {
|
|||
visit(cb, matched.Borrowed(), current.Borrowed());
|
||||
}
|
||||
|
||||
current = move(tmp_vec_);
|
||||
current = std::move(tmp_vec_);
|
||||
}
|
||||
|
||||
// Efficiently unify multiple sub results with specified logical op
|
||||
|
@ -240,7 +240,7 @@ struct BasicSearch {
|
|||
|
||||
IndexResult out{std::move(sub_results[0])};
|
||||
for (auto& matched : absl::MakeSpan(sub_results).subspan(1))
|
||||
Merge(move(matched), &out, op);
|
||||
Merge(std::move(matched), &out, op);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -444,7 +444,7 @@ struct BasicSearch {
|
|||
} // namespace
|
||||
|
||||
FieldIndices::FieldIndices(Schema schema, PMR_NS::memory_resource* mr)
|
||||
: schema_{move(schema)}, all_ids_{}, indices_{} {
|
||||
: schema_{std::move(schema)}, all_ids_{}, indices_{} {
|
||||
CreateIndices(mr);
|
||||
CreateSortIndices(mr);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ TEST_F(SearchParserTest, Scanner) {
|
|||
NEXT_EQ(TOK_TERM, string, "Печкин");
|
||||
|
||||
double d;
|
||||
absl::SimpleAtod("33.3", &d);
|
||||
ASSERT_TRUE(absl::SimpleAtod("33.3", &d));
|
||||
SetInput("33.3");
|
||||
NEXT_EQ(TOK_DOUBLE, double, d);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ template <typename T> struct SimpleValueSortIndex : BaseSortIndex {
|
|||
|
||||
std::vector<ResultScore> Sort(std::vector<DocId>* ids, size_t limit, bool desc) const override;
|
||||
|
||||
virtual void Add(DocId id, DocumentAccessor* doc, std::string_view field);
|
||||
virtual void Remove(DocId id, DocumentAccessor* doc, std::string_view field);
|
||||
void Add(DocId id, DocumentAccessor* doc, std::string_view field) override;
|
||||
void Remove(DocId id, DocumentAccessor* doc, std::string_view field) override;
|
||||
|
||||
protected:
|
||||
virtual T Get(DocId id, DocumentAccessor* doc, std::string_view field) = 0;
|
||||
|
|
|
@ -118,7 +118,7 @@ struct Connection::Shutdown {
|
|||
ShutdownHandle next_handle = 1;
|
||||
|
||||
ShutdownHandle Add(ShutdownCb cb) {
|
||||
map[next_handle] = move(cb);
|
||||
map[next_handle] = std::move(cb);
|
||||
return next_handle++;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,10 @@ struct Connection::Shutdown {
|
|||
|
||||
Connection::PubMessage::PubMessage(string pattern, shared_ptr<char[]> buf, size_t channel_len,
|
||||
size_t message_len)
|
||||
: pattern{move(pattern)}, buf{move(buf)}, channel_len{channel_len}, message_len{message_len} {
|
||||
: pattern{std::move(pattern)},
|
||||
buf{std::move(buf)},
|
||||
channel_len{channel_len},
|
||||
message_len{message_len} {
|
||||
}
|
||||
|
||||
string_view Connection::PubMessage::Channel() const {
|
||||
|
@ -694,7 +697,7 @@ void Connection::DispatchCommand(uint32_t consumed, mi_heap_t* heap) {
|
|||
evc_.notify();
|
||||
|
||||
} else {
|
||||
SendAsync(MessageHandle{FromArgs(move(tmp_parse_args_), heap)});
|
||||
SendAsync(MessageHandle{FromArgs(std::move(tmp_parse_args_), heap)});
|
||||
if (dispatch_q_.size() > 10)
|
||||
ThisFiber::Yield();
|
||||
}
|
||||
|
@ -1097,7 +1100,7 @@ void Connection::DispatchFiber(util::FiberSocketBase* peer) {
|
|||
if (squashing_enabled && threshold_reached && are_all_plain_cmds && !skip_next_squashing_) {
|
||||
SquashPipeline(builder);
|
||||
} else {
|
||||
MessageHandle msg = move(dispatch_q_.front());
|
||||
MessageHandle msg = std::move(dispatch_q_.front());
|
||||
dispatch_q_.pop_front();
|
||||
|
||||
if (ShouldEndDispatchFiber(msg)) {
|
||||
|
@ -1168,7 +1171,7 @@ Connection::PipelineMessagePtr Connection::GetFromPipelinePool() {
|
|||
return nullptr;
|
||||
|
||||
free_req_release_weight = 0; // Reset the release weight.
|
||||
auto ptr = move(pipeline_req_pool_.back());
|
||||
auto ptr = std::move(pipeline_req_pool_.back());
|
||||
stats_->pipeline_cmd_cache_bytes -= ptr->StorageCapacity();
|
||||
pipeline_req_pool_.pop_back();
|
||||
return ptr;
|
||||
|
@ -1211,11 +1214,11 @@ bool Connection::IsCurrentlyDispatching() const {
|
|||
|
||||
void Connection::SendPubMessageAsync(PubMessage msg) {
|
||||
void* ptr = mi_malloc(sizeof(PubMessage));
|
||||
SendAsync({PubMessagePtr{new (ptr) PubMessage{move(msg)}, MessageDeleter{}}});
|
||||
SendAsync({PubMessagePtr{new (ptr) PubMessage{std::move(msg)}, MessageDeleter{}}});
|
||||
}
|
||||
|
||||
void Connection::SendMonitorMessageAsync(string msg) {
|
||||
SendAsync({MonitorMessage{move(msg)}});
|
||||
SendAsync({MonitorMessage{std::move(msg)}});
|
||||
}
|
||||
|
||||
void Connection::SendAclUpdateAsync(AclUpdateMessage msg) {
|
||||
|
@ -1302,7 +1305,7 @@ void Connection::RecycleMessage(MessageHandle msg) {
|
|||
pending_pipeline_cmd_cnt_--;
|
||||
if (stats_->pipeline_cmd_cache_bytes < queue_backpressure_->pipeline_cache_limit) {
|
||||
stats_->pipeline_cmd_cache_bytes += (*pipe)->StorageCapacity();
|
||||
pipeline_req_pool_.push_back(move(*pipe));
|
||||
pipeline_req_pool_.push_back(std::move(*pipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -425,7 +425,7 @@ auto RedisParser::ConsumeBulk(Buffer str) -> Result {
|
|||
vector<uint8_t> nb(bulk_len_);
|
||||
memcpy(nb.data(), str.data(), len);
|
||||
bulk_str = Buffer{nb.data(), len};
|
||||
buf_stash_.emplace_back(move(nb));
|
||||
buf_stash_.emplace_back(std::move(nb));
|
||||
is_broken_token_ = true;
|
||||
cached_expr_->back().has_support = true;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,9 @@ void CapturingReplyBuilder::SendError(std::string_view str, std::string_view typ
|
|||
void CapturingReplyBuilder::SendError(ErrorReply error) {
|
||||
SKIP_LESS(ReplyMode::ONLY_ERR);
|
||||
|
||||
string message = visit([](auto&& str) -> string { return string{move(str)}; }, error.message);
|
||||
Capture(Error{move(message), error.kind});
|
||||
string message =
|
||||
visit([](auto&& str) -> string { return string{std::move(str)}; }, error.message);
|
||||
Capture(Error{std::move(message), error.kind});
|
||||
}
|
||||
|
||||
void CapturingReplyBuilder::SendMGetResponse(MGetResponse resp) {
|
||||
|
@ -57,7 +58,7 @@ void CapturingReplyBuilder::SendSimpleStrArr(StrSpan arr) {
|
|||
for (unsigned i = 0; i < warr.Size(); i++)
|
||||
sarr[i] = warr[i];
|
||||
|
||||
Capture(StrArrPayload{true, ARRAY, move(sarr)});
|
||||
Capture(StrArrPayload{true, ARRAY, std::move(sarr)});
|
||||
}
|
||||
|
||||
void CapturingReplyBuilder::SendStringArr(StrSpan arr, CollectionType type) {
|
||||
|
@ -70,7 +71,7 @@ void CapturingReplyBuilder::SendStringArr(StrSpan arr, CollectionType type) {
|
|||
for (unsigned i = 0; i < warr.Size(); i++)
|
||||
sarr[i] = warr[i];
|
||||
|
||||
Capture(StrArrPayload{false, type, move(sarr)});
|
||||
Capture(StrArrPayload{false, type, std::move(sarr)});
|
||||
}
|
||||
|
||||
void CapturingReplyBuilder::SendNull() {
|
||||
|
@ -114,7 +115,7 @@ void CapturingReplyBuilder::StartCollection(unsigned len, CollectionType type) {
|
|||
|
||||
CapturingReplyBuilder::Payload CapturingReplyBuilder::Take() {
|
||||
CHECK(stack_.empty());
|
||||
Payload pl = move(current_);
|
||||
Payload pl = std::move(current_);
|
||||
current_ = monostate{};
|
||||
return pl;
|
||||
}
|
||||
|
@ -125,7 +126,7 @@ void CapturingReplyBuilder::SendDirect(Payload&& val) {
|
|||
ReplyMode min_mode = is_err ? ReplyMode::ONLY_ERR : ReplyMode::FULL;
|
||||
if (reply_mode_ >= min_mode) {
|
||||
DCHECK_EQ(current_.index(), 0u);
|
||||
current_ = move(val);
|
||||
current_ = std::move(val);
|
||||
} else {
|
||||
current_ = monostate{};
|
||||
}
|
||||
|
@ -146,9 +147,9 @@ void CapturingReplyBuilder::Capture(Payload val) {
|
|||
|
||||
void CapturingReplyBuilder::CollapseFilledCollections() {
|
||||
while (!stack_.empty() && stack_.top().second == 0) {
|
||||
auto pl = move(stack_.top());
|
||||
auto pl = std::move(stack_.top());
|
||||
stack_.pop();
|
||||
Capture(move(pl.first));
|
||||
Capture(std::move(pl.first));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +224,7 @@ struct CaptureVisitor {
|
|||
|
||||
void CapturingReplyBuilder::Apply(Payload&& pl, RedisReplyBuilder* rb) {
|
||||
if (auto* crb = dynamic_cast<CapturingReplyBuilder*>(rb); crb != nullptr) {
|
||||
crb->SendDirect(move(pl));
|
||||
crb->SendDirect(std::move(pl));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ using absl::GetFlag;
|
|||
|
||||
ClusterSlotMigration::ClusterSlotMigration(string host_ip, uint16_t port,
|
||||
std::vector<ClusterConfig::SlotRange> slots)
|
||||
: ProtocolClient(move(host_ip), port), slots_(std::move(slots)) {
|
||||
: ProtocolClient(std::move(host_ip), port), slots_(std::move(slots)) {
|
||||
}
|
||||
|
||||
ClusterSlotMigration::~ClusterSlotMigration() {
|
||||
|
@ -31,7 +31,7 @@ ClusterSlotMigration::~ClusterSlotMigration() {
|
|||
error_code ClusterSlotMigration::Start(ConnectionContext* cntx) {
|
||||
VLOG(1) << "Starting slot migration";
|
||||
|
||||
auto check_connection_error = [this, &cntx](error_code ec, const char* msg) -> error_code {
|
||||
auto check_connection_error = [&cntx](error_code ec, const char* msg) -> error_code {
|
||||
if (ec) {
|
||||
cntx->SendError(absl::StrCat(msg, ec.message()));
|
||||
}
|
||||
|
|
|
@ -1413,7 +1413,7 @@ void DbSlice::InvalidateSlotWatches(const SlotSet& slot_ids) {
|
|||
}
|
||||
|
||||
void DbSlice::SetDocDeletionCallback(DocDeletionCallback ddcb) {
|
||||
doc_del_cb_ = move(ddcb);
|
||||
doc_del_cb_ = std::move(ddcb);
|
||||
}
|
||||
|
||||
void DbSlice::ResetUpdateEvents() {
|
||||
|
|
|
@ -113,10 +113,10 @@ GenericError RdbSnapshot::Start(SaveMode save_mode, const std::string& path,
|
|||
io_sink_.reset(file);
|
||||
|
||||
is_linux_file_ = file_type & FileType::IO_URING;
|
||||
bool align_writes = (file_type & FileType::DIRECT) != 0;
|
||||
saver_.reset(new RdbSaver(io_sink_.get(), save_mode, align_writes));
|
||||
|
||||
saver_.reset(new RdbSaver(io_sink_.get(), save_mode, file_type | FileType::DIRECT));
|
||||
|
||||
return saver_->SaveHeader(move(glob_data));
|
||||
return saver_->SaveHeader(std::move(glob_data));
|
||||
}
|
||||
|
||||
error_code RdbSnapshot::SaveBody() {
|
||||
|
@ -140,7 +140,7 @@ void RdbSnapshot::StartInShard(EngineShard* shard) {
|
|||
}
|
||||
|
||||
SaveStagesController::SaveStagesController(SaveStagesInputs&& inputs)
|
||||
: SaveStagesInputs{move(inputs)} {
|
||||
: SaveStagesInputs{std::move(inputs)} {
|
||||
start_time_ = absl::Now();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ struct SaveStagesInputs {
|
|||
class RdbSnapshot {
|
||||
public:
|
||||
RdbSnapshot(FiberQueueThreadPool* fq_tp, SnapshotStorage* snapshot_storage)
|
||||
: fq_tp_{fq_tp}, snapshot_storage_{snapshot_storage} {
|
||||
: snapshot_storage_{snapshot_storage} {
|
||||
}
|
||||
|
||||
GenericError Start(SaveMode save_mode, const string& path, const RdbSaver::GlobalData& glob_data);
|
||||
|
@ -56,7 +56,6 @@ class RdbSnapshot {
|
|||
private:
|
||||
bool started_ = false;
|
||||
bool is_linux_file_ = false;
|
||||
util::fb2::FiberQueueThreadPool* fq_tp_ = nullptr;
|
||||
SnapshotStorage* snapshot_storage_ = nullptr;
|
||||
|
||||
unique_ptr<io::Sink> io_sink_;
|
||||
|
|
|
@ -216,8 +216,6 @@ class DflyCmd {
|
|||
private:
|
||||
ServerFamily* sf_; // Not owned
|
||||
|
||||
TxId journal_txid_ = 0;
|
||||
|
||||
uint32_t next_sync_id_ = 1;
|
||||
|
||||
using ReplicaInfoMap = absl::btree_map<uint32_t, std::shared_ptr<ReplicaInfo>>;
|
||||
|
|
|
@ -324,7 +324,7 @@ void Renamer::Find(Transaction* t) {
|
|||
return OpStatus::OK;
|
||||
};
|
||||
|
||||
t->Execute(move(cb), false);
|
||||
t->Execute(std::move(cb), false);
|
||||
};
|
||||
|
||||
void Renamer::Finalize(Transaction* t, bool skip_exist_dest) {
|
||||
|
@ -734,7 +734,7 @@ void GenericFamily::Persist(CmdArgList args, ConnectionContext* cntx) {
|
|||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) { return OpPersist(t->GetOpArgs(shard), key); };
|
||||
|
||||
OpStatus status = cntx->transaction->ScheduleSingleHop(move(cb));
|
||||
OpStatus status = cntx->transaction->ScheduleSingleHop(std::move(cb));
|
||||
if (status == OpStatus::OK)
|
||||
cntx->SendLong(1);
|
||||
else
|
||||
|
@ -794,7 +794,7 @@ void GenericFamily::Expire(CmdArgList args, ConnectionContext* cntx) {
|
|||
return OpExpire(t->GetOpArgs(shard), key, params);
|
||||
};
|
||||
|
||||
OpStatus status = cntx->transaction->ScheduleSingleHop(move(cb));
|
||||
OpStatus status = cntx->transaction->ScheduleSingleHop(std::move(cb));
|
||||
cntx->SendLong(status == OpStatus::OK);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ error_code IoMgr::Open(const string& path) {
|
|||
auto res = OpenLinux(path, kFlags, 0666);
|
||||
if (!res)
|
||||
return res.error();
|
||||
backing_file_ = move(res.value());
|
||||
backing_file_ = std::move(res.value());
|
||||
Proactor* proactor = (Proactor*)ProactorBase::me();
|
||||
{
|
||||
FiberCall fc(proactor);
|
||||
|
@ -80,7 +80,7 @@ error_code IoMgr::GrowAsync(size_t len, GrowCb cb) {
|
|||
Proactor* proactor = (Proactor*)ProactorBase::me();
|
||||
|
||||
SubmitEntry entry = proactor->GetSubmitEntry(
|
||||
[this, len, cb = move(cb)](auto*, Proactor::IoResult res, uint32_t) {
|
||||
[this, len, cb = std::move(cb)](auto*, Proactor::IoResult res, uint32_t) {
|
||||
this->flags.grow_progress = 0;
|
||||
sz_ += (res == 0 ? len : 0);
|
||||
cb(res);
|
||||
|
@ -99,9 +99,9 @@ error_code IoMgr::WriteAsync(size_t offset, string_view blob, WriteCb cb) {
|
|||
|
||||
Proactor* proactor = (Proactor*)ProactorBase::me();
|
||||
|
||||
auto ring_cb = [cb = move(cb)](auto*, Proactor::IoResult res, uint32_t flags) { cb(res); };
|
||||
auto ring_cb = [cb = std::move(cb)](auto*, Proactor::IoResult res, uint32_t flags) { cb(res); };
|
||||
|
||||
SubmitEntry se = proactor->GetSubmitEntry(move(ring_cb), 0);
|
||||
SubmitEntry se = proactor->GetSubmitEntry(std::move(ring_cb), 0);
|
||||
se.PrepWrite(backing_file_->fd(), blob.data(), blob.size(), offset);
|
||||
|
||||
return error_code{};
|
||||
|
|
|
@ -71,14 +71,11 @@ class JournalSlice {
|
|||
mutable util::SharedMutex cb_mu_;
|
||||
std::vector<std::pair<uint32_t, ChangeCallback>> change_cb_arr_ ABSL_GUARDED_BY(cb_mu_);
|
||||
|
||||
size_t file_offset_ = 0;
|
||||
LSN lsn_ = 1;
|
||||
|
||||
uint32_t slice_index_ = UINT32_MAX;
|
||||
uint32_t next_cb_id_ = 1;
|
||||
std::error_code status_ec_;
|
||||
|
||||
bool lameduck_ = false;
|
||||
};
|
||||
|
||||
} // namespace journal
|
||||
|
|
|
@ -1014,7 +1014,7 @@ vector<OptString> OpJsonMGet(JsonExpression expression, const Transaction* t, En
|
|||
VLOG(1) << "Failed to dump JSON array to string with the error: " << ec.message();
|
||||
}
|
||||
|
||||
dest = move(str);
|
||||
dest = std::move(str);
|
||||
}
|
||||
|
||||
return response;
|
||||
|
@ -1157,7 +1157,7 @@ void JsonFamily::Set(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<bool> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<bool> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
if (*result) {
|
||||
|
@ -1187,11 +1187,11 @@ void JsonFamily::Resp(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpResp(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpResp(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<JsonType>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<JsonType>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
|
@ -1242,11 +1242,11 @@ void JsonFamily::Debug(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return func(t->GetOpArgs(shard), key, move(expression));
|
||||
return func(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1297,7 +1297,7 @@ void JsonFamily::MGet(CmdArgList args, ConnectionContext* cntx) {
|
|||
continue;
|
||||
|
||||
uint32_t indx = transaction->ReverseArgIndex(sid, j);
|
||||
results[indx] = move(res[j]);
|
||||
results[indx] = std::move(res[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1355,12 +1355,12 @@ void JsonFamily::ArrIndex(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpArrIndex(t->GetOpArgs(shard), key, move(expression), *search_value, start_index,
|
||||
return OpArrIndex(t->GetOpArgs(shard), key, std::move(expression), *search_value, start_index,
|
||||
end_index);
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptLong>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptLong>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1388,7 +1388,7 @@ void JsonFamily::ArrInsert(CmdArgList args, ConnectionContext* cntx) {
|
|||
return;
|
||||
}
|
||||
|
||||
new_values.emplace_back(move(*val));
|
||||
new_values.emplace_back(std::move(*val));
|
||||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
|
@ -1396,7 +1396,7 @@ void JsonFamily::ArrInsert(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
} else {
|
||||
|
@ -1422,7 +1422,7 @@ void JsonFamily::ArrAppend(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
} else {
|
||||
|
@ -1458,7 +1458,7 @@ void JsonFamily::ArrTrim(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
} else {
|
||||
|
@ -1492,7 +1492,7 @@ void JsonFamily::ArrPop(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptString>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptString>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
rb->StartArray(result->size());
|
||||
|
@ -1517,7 +1517,7 @@ void JsonFamily::Clear(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<long> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<long> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
cntx->SendLong(*result);
|
||||
|
@ -1540,7 +1540,7 @@ void JsonFamily::StrAppend(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1563,11 +1563,11 @@ void JsonFamily::ObjKeys(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpObjKeys(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpObjKeys(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<StringVec>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<StringVec>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
rb->StartArray(result->size());
|
||||
|
@ -1595,7 +1595,7 @@ void JsonFamily::Del(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<long> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<long> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
cntx->SendLong(*result);
|
||||
}
|
||||
|
||||
|
@ -1615,7 +1615,7 @@ void JsonFamily::NumIncrBy(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
cntx->SendSimpleString(*result);
|
||||
|
@ -1640,7 +1640,7 @@ void JsonFamily::NumMultBy(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
cntx->SendSimpleString(*result);
|
||||
|
@ -1658,7 +1658,7 @@ void JsonFamily::Toggle(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptBool>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptBool>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1681,11 +1681,11 @@ void JsonFamily::Type(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpType(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpType(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<string>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<string>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
if (result->empty()) {
|
||||
|
@ -1717,11 +1717,11 @@ void JsonFamily::ArrLen(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpArrLen(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpArrLen(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1744,11 +1744,11 @@ void JsonFamily::ObjLen(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpObjLen(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpObjLen(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1771,11 +1771,11 @@ void JsonFamily::StrLen(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
return OpStrLen(t->GetOpArgs(shard), key, move(expression));
|
||||
return OpStrLen(t->GetOpArgs(shard), key, std::move(expression));
|
||||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<vector<OptSizeT>> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
PrintOptVec(cntx, result);
|
||||
|
@ -1821,7 +1821,7 @@ void JsonFamily::Get(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
}
|
||||
|
||||
expressions.emplace_back(expr_str, move(expr));
|
||||
expressions.emplace_back(expr_str, std::move(expr));
|
||||
}
|
||||
|
||||
if (auto err = parser.Error(); err)
|
||||
|
@ -1833,7 +1833,7 @@ void JsonFamily::Get(CmdArgList args, ConnectionContext* cntx) {
|
|||
};
|
||||
|
||||
Transaction* trans = cntx->transaction;
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(move(cb));
|
||||
OpResult<string> result = trans->ScheduleSingleHopT(std::move(cb));
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (result) {
|
||||
rb->SendBulkString(*result);
|
||||
|
|
|
@ -441,7 +441,7 @@ OpResult<string> MoveTwoShards(Transaction* trans, string_view src, string_view
|
|||
return OpStatus::OK;
|
||||
};
|
||||
|
||||
trans->Execute(move(cb), false);
|
||||
trans->Execute(std::move(cb), false);
|
||||
|
||||
if (!find_res[0] || find_res[1].status() == OpStatus::WRONG_TYPE) {
|
||||
result = find_res[0] ? find_res[1] : find_res[0];
|
||||
|
@ -476,7 +476,7 @@ OpResult<string> MoveTwoShards(Transaction* trans, string_view src, string_view
|
|||
|
||||
return OpStatus::OK;
|
||||
};
|
||||
trans->Execute(move(cb), true);
|
||||
trans->Execute(std::move(cb), true);
|
||||
result = std::move(find_res[0].value());
|
||||
}
|
||||
|
||||
|
@ -1208,7 +1208,7 @@ void ListFamily::BPopGeneric(ListDir dir, CmdArgList args, ConnectionContext* cn
|
|||
|
||||
cntx->conn_state.is_blocking = true;
|
||||
OpResult<string> popped_key = container_utils::RunCbOnFirstNonEmptyBlocking(
|
||||
transaction, OBJ_LIST, move(cb), unsigned(timeout * 1000));
|
||||
transaction, OBJ_LIST, std::move(cb), unsigned(timeout * 1000));
|
||||
cntx->conn_state.is_blocking = false;
|
||||
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||
if (popped_key) {
|
||||
|
|
|
@ -118,7 +118,7 @@ bool MultiCommandSquasher::ExecuteStandalone(StoredCmd* cmd) {
|
|||
|
||||
if (verify_commands_) {
|
||||
if (auto err = service_->VerifyCommandState(cmd->Cid(), args, *cntx_); err) {
|
||||
cntx_->SendError(move(*err));
|
||||
cntx_->SendError(std::move(*err));
|
||||
return !error_abort_;
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ OpStatus MultiCommandSquasher::SquashedHopCb(Transaction* parent_tx, EngineShard
|
|||
if (verify_commands_) {
|
||||
// The shared context is used for state verification, the local one is only for replies
|
||||
if (auto err = service_->VerifyCommandState(cmd->Cid(), args, *cntx_); err) {
|
||||
crb.SendError(*move(err));
|
||||
crb.SendError(std::move(*err));
|
||||
sinfo.replies.emplace_back(crb.Take());
|
||||
continue;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ bool MultiCommandSquasher::ExecuteSquashed() {
|
|||
|
||||
aborted |= error_abort_ && CapturingReplyBuilder::GetError(replies.back());
|
||||
|
||||
CapturingReplyBuilder::Apply(move(replies.back()), rb);
|
||||
CapturingReplyBuilder::Apply(std::move(replies.back()), rb);
|
||||
replies.pop_back();
|
||||
|
||||
if (aborted)
|
||||
|
|
|
@ -245,7 +245,7 @@ io::Result<string, GenericError> ScriptMgr::Insert(string_view body, Interpreter
|
|||
string result;
|
||||
Interpreter::AddResult add_result = interpreter->AddFunction(sha, body, &result);
|
||||
if (add_result == Interpreter::COMPILE_ERR)
|
||||
return nonstd::make_unexpected(GenericError{move(result)});
|
||||
return nonstd::make_unexpected(GenericError{std::move(result)});
|
||||
|
||||
lock_guard lk{mu_};
|
||||
auto [it, _] = db_.emplace(sha, InternalScriptData{params, nullptr});
|
||||
|
@ -280,7 +280,8 @@ vector<pair<string, ScriptMgr::ScriptData>> ScriptMgr::GetAll() const {
|
|||
for (const auto& [sha, data] : db_) {
|
||||
string body = data.body ? string{data.body.get()} : string{};
|
||||
string orig_body = data.orig_body ? string{data.orig_body.get()} : string{};
|
||||
res.emplace_back(string{sha.data(), sha.size()}, ScriptData{data, move(body), move(orig_body)});
|
||||
res.emplace_back(string{sha.data(), sha.size()},
|
||||
ScriptData{data, std::move(body), std::move(orig_body)});
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -337,7 +337,7 @@ void SearchFamily::FtCreate(CmdArgList args, ConnectionContext* cntx) {
|
|||
auto schema = ParseSchemaOrReply(index.type, parser.Tail(), cntx);
|
||||
if (!schema)
|
||||
return;
|
||||
index.schema = move(*schema);
|
||||
index.schema = std::move(*schema);
|
||||
break; // SCHEMA always comes last
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ void SearchFamily::FtCreate(CmdArgList args, ConnectionContext* cntx) {
|
|||
return cntx->SendError("Index already exists");
|
||||
}
|
||||
|
||||
auto idx_ptr = make_shared<DocIndex>(move(index));
|
||||
auto idx_ptr = make_shared<DocIndex>(std::move(index));
|
||||
cntx->transaction->Execute(
|
||||
[idx_name, idx_ptr](auto* tx, auto* es) {
|
||||
es->search_indices()->InitIndex(tx->GetOpArgs(es), idx_name, idx_ptr);
|
||||
|
|
|
@ -1818,7 +1818,7 @@ void ServerFamily::Info(CmdArgList args, ConnectionContext* cntx) {
|
|||
|
||||
auto unknown_cmd = service_.UknownCmdMap();
|
||||
|
||||
append_sorted("cmdstat_", move(commands));
|
||||
append_sorted("cmdstat_", std::move(commands));
|
||||
append_sorted("unknown_",
|
||||
vector<pair<string_view, uint64_t>>(unknown_cmd.cbegin(), unknown_cmd.cend()));
|
||||
}
|
||||
|
|
|
@ -169,7 +169,6 @@ const uint32_t STREAM_LISTPACK_MAX_PRE_ALLOCATE = 4096;
|
|||
/* Every stream item inside the listpack, has a flags field that is used to
|
||||
* mark the entry as deleted, or having the same field as the "master"
|
||||
* entry at the start of the listpack. */
|
||||
const uint32_t STREAM_ITEM_FLAG_NONE = 0; /* No special flags. */
|
||||
const uint32_t STREAM_ITEM_FLAG_DELETED = (1 << 0); /* Entry is deleted. Skip it. */
|
||||
const uint32_t STREAM_ITEM_FLAG_SAMEFIELDS = (1 << 1); /* Same fields as master entry. */
|
||||
|
||||
|
@ -941,7 +940,7 @@ vector<Record> GetStreamRecords(stream* s, streamID start, streamID end, bool re
|
|||
string skey(reinterpret_cast<char*>(key), key_len);
|
||||
string sval(reinterpret_cast<char*>(value), value_len);
|
||||
|
||||
rec.kv_arr.emplace_back(move(skey), move(sval));
|
||||
rec.kv_arr.emplace_back(std::move(skey), std::move(sval));
|
||||
}
|
||||
records.push_back(std::move(rec));
|
||||
arraylen++;
|
||||
|
|
|
@ -643,7 +643,7 @@ OpStatus SetCmd::SetExisting(const SetParams& params, PrimeIterator it, ExpireIt
|
|||
return OpStatus::WRONG_TYPE;
|
||||
|
||||
string val = GetString(shard, prime_value);
|
||||
params.prev_val->emplace(move(val));
|
||||
params.prev_val->emplace(std::move(val));
|
||||
}
|
||||
|
||||
DbSlice& db_slice = shard->db_slice();
|
||||
|
|
|
@ -70,7 +70,7 @@ TestConnection::TestConnection(Protocol protocol, io::StringSink* sink)
|
|||
}
|
||||
|
||||
void TestConnection::SendPubMessageAsync(PubMessage pmsg) {
|
||||
messages.push_back(move(pmsg));
|
||||
messages.push_back(std::move(pmsg));
|
||||
}
|
||||
|
||||
std::string TestConnection::RemoteEndpointStr() const {
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace facade;
|
|||
class TestConnection : public facade::Connection {
|
||||
public:
|
||||
TestConnection(Protocol protocol, io::StringSink* sink);
|
||||
std::string RemoteEndpointStr() const;
|
||||
std::string RemoteEndpointStr() const override;
|
||||
|
||||
void SendPubMessageAsync(PubMessage pmsg) final;
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ void TieredStorage::InitiateGrow(size_t grow_size) {
|
|||
}
|
||||
};
|
||||
|
||||
error_code ec = io_mgr_.GrowAsync(grow_size, move(cb));
|
||||
error_code ec = io_mgr_.GrowAsync(grow_size, std::move(cb));
|
||||
CHECK(!ec) << "TBD"; // TODO
|
||||
}
|
||||
|
||||
|
|
|
@ -1153,7 +1153,7 @@ bool Transaction::WaitOnWatch(const time_point& tp, WaitKeysProvider wkeys_provi
|
|||
return t->WatchInShard(keys, shard);
|
||||
};
|
||||
|
||||
Execute(move(cb), true);
|
||||
Execute(std::move(cb), true);
|
||||
|
||||
coordinator_state_ |= COORD_BLOCKED;
|
||||
|
||||
|
@ -1168,14 +1168,14 @@ bool Transaction::WaitOnWatch(const time_point& tp, WaitKeysProvider wkeys_provi
|
|||
cv_status status = cv_status::no_timeout;
|
||||
if (tp == time_point::max()) {
|
||||
DVLOG(1) << "WaitOnWatch foreva " << DebugId();
|
||||
blocking_ec_.await(move(wake_cb));
|
||||
blocking_ec_.await(std::move(wake_cb));
|
||||
DVLOG(1) << "WaitOnWatch AfterWait";
|
||||
} else {
|
||||
DVLOG(1) << "WaitOnWatch TimeWait for "
|
||||
<< duration_cast<milliseconds>(tp - time_point::clock::now()).count() << " ms "
|
||||
<< DebugId();
|
||||
|
||||
status = blocking_ec_.await_until(move(wake_cb), tp);
|
||||
status = blocking_ec_.await_until(std::move(wake_cb), tp);
|
||||
|
||||
DVLOG(1) << "WaitOnWatch await_until " << int(status);
|
||||
}
|
||||
|
|
|
@ -735,7 +735,7 @@ ScoredMap FromObject(const CompactObj& co, double weight) {
|
|||
|
||||
for (auto& elem : arr) {
|
||||
elem.second *= weight;
|
||||
res.emplace(move(elem));
|
||||
res.emplace(std::move(elem));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -985,7 +985,6 @@ OpResult<AddResult> OpAdd(const OpArgs& op_args, const ZParams& zparams, string_
|
|||
|
||||
unsigned added = 0;
|
||||
unsigned updated = 0;
|
||||
unsigned processed = 0;
|
||||
|
||||
sds& tmp_str = op_args.shard->tmp_str1;
|
||||
double new_score = 0;
|
||||
|
@ -1035,8 +1034,6 @@ OpResult<AddResult> OpAdd(const OpArgs& op_args, const ZParams& zparams, string_
|
|||
added++;
|
||||
if (retflags & ZADD_OUT_UPDATED)
|
||||
updated++;
|
||||
if (!(retflags & ZADD_OUT_NOP))
|
||||
processed++;
|
||||
}
|
||||
|
||||
// if we migrated to skip_list - update listpack stats.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue