mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 21:50:49 +01:00
Problem: code duplication around options_t::conflate
Solution: extract functionality into get_effective_conflate_option
This commit is contained in:
@@ -268,6 +268,15 @@ struct options_t
|
||||
std::map<std::string, std::string> app_metadata;
|
||||
};
|
||||
|
||||
inline bool get_effective_conflate_option (const options_t &options)
|
||||
{
|
||||
// conflate is only effective for some socket types
|
||||
return options.conflate
|
||||
&& (options.type == ZMQ_DEALER || options.type == ZMQ_PULL
|
||||
|| options.type == ZMQ_PUSH || options.type == ZMQ_PUB
|
||||
|| options.type == ZMQ_SUB);
|
||||
}
|
||||
|
||||
int do_getsockopt (void *const optval_,
|
||||
size_t *const optvallen_,
|
||||
const void *value_,
|
||||
|
||||
Reference in New Issue
Block a user