MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / takeOwnership

Method takeOwnership

Bcore/src/main/cpp/Dobby/tests/catch.hpp:9607–9614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9605}
9606
9607void StringRef::takeOwnership() {
9608 if (!isOwned()) {
9609 m_data = new char[m_size + 1];
9610 memcpy(m_data, m_start, m_size);
9611 m_data[m_size] = '\0';
9612 m_start = m_data;
9613 }
9614}
9615auto StringRef::substr(size_type start, size_type size) const noexcept -> StringRef {
9616 if (start < m_size)
9617 return StringRef(m_start + start, size);

Callers 1

c_strMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected