MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / partition

Method partition

Sources/Shared/Containers/StringView.cpp:1072–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070 }
1071
1072 template<class T> StaticArray<3, BasicStringView<T>> BasicStringView<T>::partition(const char separator) const {
1073 const std::size_t size = this->size();
1074 T* const pos = static_cast<T*>(std::memchr(_data, separator, size));
1075 return {
1076 pos ? prefix(pos) : *this,
1077 pos ? slice(pos, pos + 1) : exceptPrefix(size),
1078 pos ? suffix(pos + 1) : exceptPrefix(size)
1079 };
1080 }
1081
1082 template<class T> StaticArray<3, BasicStringView<T>> BasicStringView<T>::partition(const StringView separator) const {
1083 const char* const separatorData = separator.data();

Callers

nothing calls this directly

Calls 8

sizeMethod · 0.95
prefixFunction · 0.85
sliceFunction · 0.85
exceptPrefixFunction · 0.85
suffixFunction · 0.85
stringFindStringFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected