MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / split

Method split

lib/core/bytes.cc:192–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192std::vector<Bytes> Bytes::split(uint8_t separator) const
193{
194 std::vector<Bytes> vector;
195
196 int lastEnd = 0;
197 for (int i = 0; i < size(); i++)
198 {
199 if ((*this)[i] == separator)
200 {
201 vector.push_back(this->slice(lastEnd, i - lastEnd));
202 lastEnd = i + 1;
203 }
204 }
205 vector.push_back(this->slice(lastEnd));
206
207 return vector;
208}
209
210std::vector<bool> Bytes::toBits() const
211{

Callers 4

CbmfsDirentMethod · 0.45
DirectoryMethod · 0.45
upgradeFluxFileFunction · 0.45
test_splitFunction · 0.45

Calls 2

sliceMethod · 0.95
push_backMethod · 0.45

Tested by 1

test_splitFunction · 0.36