MCPcopy Create free account
hub / github.com/LUX-Core/lux / overlapsWith

Method overlapsWith

src/cpp-ethereum/libdevcore/vector_ref.h:67–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 void retarget(_T* _d, size_t _s) { m_data = _d; m_count = _s; }
66 void retarget(std::vector<_T> const& _t) { m_data = _t.data(); m_count = _t.size(); }
67 template <class T> bool overlapsWith(vector_ref<T> _t) const { void const* f1 = data(); void const* t1 = data() + size(); void const* f2 = _t.data(); void const* t2 = _t.data() + _t.size(); return f1 < t2 && t1 > f2; }
68 /// Copies the contents of this vector_ref to the contents of @a _t, up to the max size of @a _t.
69 void copyTo(vector_ref<typename std::remove_const<_T>::type> _t) const { if (overlapsWith(_t)) memmove(_t.data(), m_data, std::min(_t.size(), m_count) * sizeof(_T)); else memcpy(_t.data(), m_data, std::min(_t.size(), m_count) * sizeof(_T)); }
70 /// Copies the contents of this vector_ref to the contents of @a _t, and zeros further trailing elements in @a _t.

Callers

nothing calls this directly

Calls 4

dataFunction · 0.85
sizeFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected