Skip to content

Commit

Permalink
minor coding style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sewenew committed Jul 19, 2021
1 parent d45c48f commit 6614fad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/sw/redis++/async_connection_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ class SafeAsyncConnection {
}

AsyncConnection& connection() {
assert(_connection);

return *_connection;
}

Expand Down Expand Up @@ -193,17 +195,17 @@ class GuardedAsyncConnection {
}
}

AsyncConnectionSPtr& connection() {
return _connection;
AsyncConnection& connection() {
assert(_connection);

return *_connection;
}

private:
AsyncConnectionPoolSPtr _pool;
AsyncConnectionSPtr _connection;
};

using GuardedAsyncConnectionSPtr = std::shared_ptr<GuardedAsyncConnection>;

}

}
Expand Down
4 changes: 2 additions & 2 deletions src/sw/redis++/async_redis_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ class AsyncRedisCluster {

GuardedAsyncConnection connection(pool);

return connection.connection()->send<Result>(_pool, key, std::forward<Args>(args)...);
return connection.connection().send<Result>(_pool, key, std::forward<Args>(args)...);
}

template <typename Result, typename ResultParser, typename ...Args>
Expand All @@ -762,7 +762,7 @@ class AsyncRedisCluster {

GuardedAsyncConnection connection(pool);

return connection.connection()->
return connection.connection().
send<Result, ResultParser>(_pool, key, std::forward<Args>(args)...);
}

Expand Down
2 changes: 1 addition & 1 deletion src/sw/redis++/async_shards_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ bool AsyncShardsPool::_redeliver_events(std::queue<RedeliverEvent> &events) {

GuardedAsyncConnection connection(pool);

connection.connection()->send(std::move(async_event));
connection.connection().send(std::move(async_event));
} catch (...) {
event.event->set_exception(std::current_exception());
}
Expand Down

0 comments on commit 6614fad

Please sign in to comment.