MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetFirstNonZeroBuffer

Function GetFirstNonZeroBuffer

plugins/check_nscp_api.cpp:216–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215template<class MutableBufferSequence>
216static inline
217boost::asio::mutable_buffer GetFirstNonZeroBuffer(const MutableBufferSequence& mbs)
218{
219 namespace asio = boost::asio;
220
221 auto end (asio::buffer_sequence_end(mbs));
222
223 for (auto current (asio::buffer_sequence_begin(mbs)); current != end; ++current) {
224 asio::mutable_buffer buf (*current);
225
226 if (buf.size() > 0u) {
227 return buf;
228 }
229 }
230
231 return {};
232}
233
234/**
235 * Workaround for <https://github.com/mickem/nscp/issues/610>.

Callers 1

read_someMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected