Skip to content

Commit

Permalink
reduce useless explicit modification (#3954)
Browse files Browse the repository at this point in the history
  • Loading branch information
darionyaphet authored Mar 2, 2022
1 parent f975c8d commit 1eda1f5
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/common/base/StatusOr.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class StatusOr final {
}

// Type conversion operator, i.e. alias of `ok()'
explicit operator bool() const {
operator bool() const {
return ok();
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/datatypes/Date.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct DateTime {
sec = 0;
microsec = 0;
}
explicit DateTime(const Date& date, const Time& time) {
DateTime(const Date& date, const Time& time) {
year = date.year;
month = date.month;
day = date.day;
Expand Down
2 changes: 1 addition & 1 deletion src/common/expression/LogicalExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class LogicalExpression final : public Expression {
}

private:
explicit LogicalExpression(ObjectPool* pool, Kind kind) : Expression(pool, kind) {}
LogicalExpression(ObjectPool* pool, Kind kind) : Expression(pool, kind) {}

LogicalExpression(ObjectPool* pool, Kind kind, Expression* lhs, Expression* rhs)
: Expression(pool, kind) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/expression/RelationalExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class RelationalExpression final : public BinaryExpression {
}

private:
explicit RelationalExpression(ObjectPool* pool, Kind kind, Expression* lhs, Expression* rhs)
RelationalExpression(ObjectPool* pool, Kind kind, Expression* lhs, Expression* rhs)
: BinaryExpression(pool, kind, lhs, rhs) {}

private:
Expand Down
5 changes: 1 addition & 4 deletions src/common/expression/SubscriptExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ class SubscriptRangeExpression final : public Expression {
explicit SubscriptRangeExpression(ObjectPool* pool)
: Expression(pool, Kind::kSubscriptRange), list_(nullptr), lo_(nullptr), hi_(nullptr) {}

explicit SubscriptRangeExpression(ObjectPool* pool,
Expression* list,
Expression* lo,
Expression* hi)
SubscriptRangeExpression(ObjectPool* pool, Expression* list, Expression* lo, Expression* hi)
: Expression(pool, Kind::kSubscriptRange), list_(DCHECK_NOTNULL(list)), lo_(lo), hi_(hi) {
DCHECK(!(lo_ == nullptr && hi_ == nullptr));
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/expression/UnaryExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class UnaryExpression final : public Expression {
}

private:
explicit UnaryExpression(ObjectPool* pool, Kind kind, Expression* operand = nullptr)
UnaryExpression(ObjectPool* pool, Kind kind, Expression* operand = nullptr)
: Expression(pool, kind), operand_(operand) {}

void writeTo(Encoder& encoder) const override;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/service/QueryInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace graph {

class QueryInstance final : public boost::noncopyable, public cpp::NonMovable {
public:
explicit QueryInstance(std::unique_ptr<QueryContext> qctx, opt::Optimizer* optimizer);
QueryInstance(std::unique_ptr<QueryContext> qctx, opt::Optimizer* optimizer);
~QueryInstance() = default;

void execute();
Expand Down
2 changes: 1 addition & 1 deletion src/graph/session/ClientSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class ClientSession final {
private:
ClientSession() = default;

explicit ClientSession(meta::cpp2::Session&& session, meta::MetaClient* metaClient);
ClientSession(meta::cpp2::Session&& session, meta::MetaClient* metaClient);

private:
SpaceInfo space_; // The space that the session is using.
Expand Down
2 changes: 1 addition & 1 deletion src/meta/processors/admin/AgentHBProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AgentHBProcessor : public BaseProcessor<cpp2::AgentHBResp> {
void onFinished() override;

private:
explicit AgentHBProcessor(kvstore::KVStore* kvstore, const AgentHBCounters* counters)
AgentHBProcessor(kvstore::KVStore* kvstore, const AgentHBCounters* counters)
: BaseProcessor<cpp2::AgentHBResp>(kvstore), counters_(counters) {}

const AgentHBCounters* counters_{nullptr};
Expand Down
5 changes: 2 additions & 3 deletions src/parser/AdminSentences.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ class ShowServiceClientsSentence final : public Sentence {

class SignInServiceSentence final : public Sentence {
public:
explicit SignInServiceSentence(const meta::cpp2::ExternalServiceType& type,
ServiceClientList* clients)
SignInServiceSentence(const meta::cpp2::ExternalServiceType& type, ServiceClientList* clients)
: type_(type) {
kind_ = Kind::kSignInService;
clients_.reset(clients);
Expand Down Expand Up @@ -797,7 +796,7 @@ class ShowQueriesSentence final : public Sentence {

class QueryUniqueIdentifier final {
public:
explicit QueryUniqueIdentifier(Expression* epId, Expression* sessionId)
QueryUniqueIdentifier(Expression* epId, Expression* sessionId)
: epId_(epId), sessionId_(sessionId) {}

Expression* sessionId() const {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/Clauses.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class BoundClause final {
public:
enum BoundType : uint8_t { IN, OUT, BOTH };

explicit BoundClause(OverEdges *edges, BoundType type) {
BoundClause(OverEdges *edges, BoundType type) {
overEdges_.reset(edges);
boundType_ = type;
}
Expand Down
6 changes: 3 additions & 3 deletions src/parser/MaintainSentences.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ class DescribeEdgeSentence final : public Sentence {

class DropTagSentence final : public DropSentence {
public:
explicit DropTagSentence(std::string *name, bool ifExists) : DropSentence(ifExists) {
DropTagSentence(std::string *name, bool ifExists) : DropSentence(ifExists) {
name_.reset(name);
kind_ = Kind::kDropTag;
}
Expand All @@ -533,7 +533,7 @@ class DropTagSentence final : public DropSentence {

class DropEdgeSentence final : public DropSentence {
public:
explicit DropEdgeSentence(std::string *name, bool ifExists) : DropSentence(ifExists) {
DropEdgeSentence(std::string *name, bool ifExists) : DropSentence(ifExists) {
name_.reset(name);
kind_ = Kind::kDropEdge;
}
Expand Down Expand Up @@ -772,7 +772,7 @@ class DescribeEdgeIndexSentence final : public Sentence {

class DropTagIndexSentence final : public DropSentence {
public:
explicit DropTagIndexSentence(std::string *indexName, bool ifExists) : DropSentence(ifExists) {
DropTagIndexSentence(std::string *indexName, bool ifExists) : DropSentence(ifExists) {
indexName_.reset(indexName);
kind_ = Kind::kDropTagIndex;
}
Expand Down
10 changes: 5 additions & 5 deletions src/parser/MatchSentence.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ class MatchReturnItems final {

class MatchReturn final {
public:
explicit MatchReturn(MatchReturnItems* returnItems = nullptr,
OrderFactors* orderFactors = nullptr,
Expression* skip = nullptr,
Expression* limit = nullptr,
bool distinct = false) {
MatchReturn(MatchReturnItems* returnItems = nullptr,
OrderFactors* orderFactors = nullptr,
Expression* skip = nullptr,
Expression* limit = nullptr,
bool distinct = false) {
returnItems_.reset(returnItems);
orderFactors_.reset(orderFactors);
skip_ = skip;
Expand Down
8 changes: 4 additions & 4 deletions src/parser/MutateSentences.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ class EdgeRowList final {

class InsertEdgesSentence final : public Sentence {
public:
explicit InsertEdgesSentence(std::string *edge,
EdgeRowList *rows,
bool ifNotExists,
bool ignoreExistedIndex)
InsertEdgesSentence(std::string *edge,
EdgeRowList *rows,
bool ifNotExists,
bool ignoreExistedIndex)
: Sentence(Kind::kInsertEdges) {
edge_.reset(edge);
rows_.reset(rows);
Expand Down
6 changes: 3 additions & 3 deletions src/parser/TraverseSentences.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ class FetchVerticesSentence final : public Sentence {
yieldClause_.reset(clause);
}

explicit FetchVerticesSentence(Expression* ref, YieldClause* clause) {
FetchVerticesSentence(Expression* ref, YieldClause* clause) {
kind_ = Kind::kFetchVertices;
tags_ = std::make_unique<NameLabelList>();
vertices_.reset(new VerticesClause(ref));
yieldClause_.reset(clause);
}

explicit FetchVerticesSentence(VertexIDList* vidList, YieldClause* clause) {
FetchVerticesSentence(VertexIDList* vidList, YieldClause* clause) {
kind_ = Kind::kFetchVertices;
tags_ = std::make_unique<NameLabelList>();
vertices_.reset(new VerticesClause(vidList));
Expand Down Expand Up @@ -474,7 +474,7 @@ class FindPathSentence final : public Sentence {

class LimitSentence final : public Sentence {
public:
explicit LimitSentence(int64_t offset, int64_t count) : offset_(offset), count_(count) {
LimitSentence(int64_t offset, int64_t count) : offset_(offset), count_(count) {
kind_ = Kind::kLimit;
}

Expand Down
2 changes: 1 addition & 1 deletion src/storage/exec/DeDupNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DeDupNode : public IterateNode<T> {
public:
using RelNode<T>::doExecute;

explicit DeDupNode(nebula::DataSet* resultSet, const std::vector<size_t>& pos)
DeDupNode(nebula::DataSet* resultSet, const std::vector<size_t>& pos)
: resultSet_(resultSet), pos_(pos) {
IterateNode<T>::name_ = "DedupNode";
}
Expand Down
6 changes: 3 additions & 3 deletions src/storage/exec/IndexAggregateNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ struct ColumnStat {
class IndexAggregateNode : public IndexNode {
public:
IndexAggregateNode(const IndexAggregateNode& node);
explicit IndexAggregateNode(RuntimeContext* context,
const std::vector<std::pair<std::string, cpp2::StatType>>& statInfos,
size_t returnColumnsCount);
IndexAggregateNode(RuntimeContext* context,
const std::vector<std::pair<std::string, cpp2::StatType>>& statInfos,
size_t returnColumnsCount);

nebula::cpp2::ErrorCode init(InitContext& ctx) override;
void initStatValue();
Expand Down
2 changes: 1 addition & 1 deletion src/storage/exec/IndexNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class IndexNode {
};
/* build */
IndexNode(const IndexNode& node);
explicit IndexNode(RuntimeContext* context, const std::string& name);
IndexNode(RuntimeContext* context, const std::string& name);
virtual ~IndexNode() = default;
virtual std::unique_ptr<IndexNode> copy() = 0;
void addChild(std::unique_ptr<IndexNode> child) {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/kv/GetProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GetProcessor : public BaseProcessor<cpp2::KVGetResponse> {
void process(const cpp2::KVGetRequest& req);

protected:
explicit GetProcessor(StorageEnv* env, const ProcessorCounters* counters)
GetProcessor(StorageEnv* env, const ProcessorCounters* counters)
: BaseProcessor<cpp2::KVGetResponse>(env, counters) {}
};

Expand Down
6 changes: 3 additions & 3 deletions src/storage/test/ChainTestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ class MetaClientTestUpdater {

class FakeInternalStorageClient : public InternalStorageClient {
public:
explicit FakeInternalStorageClient(StorageEnv* env,
std::shared_ptr<folly::IOThreadPoolExecutor> pool,
Code code)
FakeInternalStorageClient(StorageEnv* env,
std::shared_ptr<folly::IOThreadPoolExecutor> pool,
Code code)
: InternalStorageClient(pool, env->metaClient_), env_(env), code_(code) {}

void chainUpdateEdge(cpp2::UpdateEdgeRequest& req,
Expand Down

0 comments on commit 1eda1f5

Please sign in to comment.