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

Merge pull request #414 from knowledge4igor/tiny_code_improvements_in_async

Tiny code improvements
parents 6e3bb2c3 25f9b474
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#pragma once #pragma once
#include <pistache/typeid.h>
#include <type_traits> #include <type_traits>
#include <functional> #include <functional>
#include <memory> #include <memory>
...@@ -14,10 +16,9 @@ ...@@ -14,10 +16,9 @@
#include <vector> #include <vector>
#include <mutex> #include <mutex>
#include <condition_variable> #include <condition_variable>
#include <stdexcept>
#include <typeinfo>
#include <pistache/optional.h>
#include <pistache/typeid.h>
#include <pistache/common.h>
namespace Pistache { namespace Pistache {
namespace Async { namespace Async {
...@@ -396,8 +397,7 @@ namespace Async { ...@@ -396,8 +397,7 @@ namespace Async {
static_assert(sizeof...(Args) == 0, static_assert(sizeof...(Args) == 0,
"Can not attach a non-void continuation to a void-Promise"); "Can not attach a non-void continuation to a void-Promise");
void doResolve(const std::shared_ptr<CoreT<void>>& core) { void doResolve(const std::shared_ptr<CoreT<void>>& /*core*/) {
UNUSED(core)
finishResolve(resolve_()); finishResolve(resolve_());
} }
...@@ -474,8 +474,7 @@ namespace Async { ...@@ -474,8 +474,7 @@ namespace Async {
static_assert(sizeof...(Args) == 0, static_assert(sizeof...(Args) == 0,
"Can not attach a non-void continuation to a void-Promise"); "Can not attach a non-void continuation to a void-Promise");
void doResolve(const std::shared_ptr<CoreT<void>>& core) { void doResolve(const std::shared_ptr<CoreT<void>>& /*core*/) {
UNUSED(core)
resolve_(); resolve_();
} }
...@@ -582,8 +581,7 @@ namespace Async { ...@@ -582,8 +581,7 @@ namespace Async {
, reject_(reject) , reject_(reject)
{ } { }
void doResolve(const std::shared_ptr<CoreT<void>>& core) { void doResolve(const std::shared_ptr<CoreT<void>>& /*core*/) {
UNUSED(core)
auto promise = resolve_(); auto promise = resolve_();
finishResolve(promise); finishResolve(promise);
} }
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#pragma once #pragma once
#include <functional>
namespace Pistache { namespace Pistache {
class TypeId { class TypeId {
......
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <pistache/async.h>
#include <pistache/common.h>
#include <thread> #include <thread>
#include <algorithm> #include <algorithm>
#include <deque> #include <deque>
...@@ -7,8 +10,6 @@ ...@@ -7,8 +10,6 @@
#include <condition_variable> #include <condition_variable>
#include <random> #include <random>
#include <pistache/async.h>
using namespace Pistache; using namespace Pistache;
Async::Promise<int> doAsync(int N) Async::Promise<int> doAsync(int N)
......
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