Unverified Commit b88af74d authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #348 from knowledge4igor/code_style_improvements_1

Tiny codestyle improvements
parents 4b351fc9 fcbf4473
......@@ -238,9 +238,9 @@ namespace Async {
return *reinterpret_cast<T*>(&storage);
}
bool isVoid() const { return false; }
bool isVoid() const override { return false; }
void *memory() {
void *memory() override {
return &storage;
}
};
......@@ -251,9 +251,9 @@ namespace Async {
: Core(State::Pending, TypeId::of<void>())
{ }
bool isVoid() const { return true; }
bool isVoid() const override { return true; }
void *memory() {
void *memory() override {
return nullptr;
}
};
......@@ -266,7 +266,7 @@ namespace Async {
, chain_(chain)
{ }
void resolve(const std::shared_ptr<Core>& core) {
void resolve(const std::shared_ptr<Core>& core) override {
if (resolveCount_ >= 1)
throw Error("Resolve must not be called more than once");
......@@ -274,7 +274,7 @@ namespace Async {
++resolveCount_;
}
void reject(const std::shared_ptr<Core>& core) {
void reject(const std::shared_ptr<Core>& core) override {
if (rejectCount_ >= 1)
throw Error("Reject must not be called more than once");
......@@ -1009,9 +1009,9 @@ namespace Async {
return Promise<T>(std::move(core));
}
bool isPending() const { return core_->state == State::Pending; }
bool isFulfilled() const { return core_->state == State::Fulfilled; }
bool isRejected() const { return core_->state == State::Rejected; }
bool isPending() const override { return core_->state == State::Pending; }
bool isFulfilled() const override { return core_->state == State::Fulfilled; }
bool isRejected() const override { return core_->state == State::Rejected; }
template<typename ResolveFunc, typename RejectFunc>
auto
......
......@@ -73,7 +73,7 @@ struct Connection : public std::enable_shared_from_this<Connection> {
Connected
};
void connect(Address addr);
void connect(const Address& addr);
void close();
bool isIdle() const;
bool isConnected() const;
......
......@@ -218,7 +218,7 @@ struct PathDecl {
};
struct Path {
Path(std::string path, Http::Method method, std::string description);
Path(std::string value, Http::Method method, std::string description);
std::string value;
Http::Method method;
......@@ -364,7 +364,7 @@ private:
struct SubPath {
SubPath(std::string prefix, PathGroup* paths);
PathBuilder route(std::string path, Http::Method method, std::string description = "");
PathBuilder route(std::string name, Http::Method method, std::string description = "");
PathBuilder route(PathDecl fragment, std::string description = "");
SubPath path(std::string prefix);
......
......@@ -358,7 +358,7 @@ Transport::handleTimeout(const std::shared_ptr<Connection>& connection) {
}
void
Connection::connect(Address addr)
Connection::connect(const Address& addr)
{
struct addrinfo hints;
struct addrinfo *addrs;
......
......@@ -56,8 +56,7 @@ PathDecl::PathDecl(
, method(method)
{ }
Path::Path(
std::string value, Http::Method method, std::string description)
Path::Path(std::string value, Http::Method method, std::string description)
: value(std::move(value))
, method(method)
, description(std::move(description))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment