| 13297 | } |
| 13298 | |
| 13299 | void StringRef::takeOwnership() { |
| 13300 | if( !isOwned() ) { |
| 13301 | m_data = new char[m_size+1]; |
| 13302 | memcpy( m_data, m_start, m_size ); |
| 13303 | m_data[m_size] = '\0'; |
| 13304 | } |
| 13305 | } |
| 13306 | auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef { |
| 13307 | if( start < m_size ) |
| 13308 | return StringRef( m_start+start, size ); |