MCPcopy Create free account
hub / github.com/ablab/spades / split

Method split

ext/src/llvm/StringRef.cpp:314–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void StringRef::split(SmallVectorImpl<StringRef> &A,
315 StringRef Separator, int MaxSplit,
316 bool KeepEmpty) const {
317 StringRef S = *this;
318
319 // Count down from MaxSplit. When MaxSplit is -1, this will just split
320 // "forever". This doesn't support splitting more than 2^31 times
321 // intentionally; if we ever want that we can make MaxSplit a 64-bit integer
322 // but that seems unlikely to be useful.
323 while (MaxSplit-- != 0) {
324 size_t Idx = S.find(Separator);
325 if (Idx == npos)
326 break;
327
328 // Push this split.
329 if (KeepEmpty || Idx > 0)
330 A.push_back(S.slice(0, Idx));
331
332 // Jump forward.
333 S = S.slice(Idx + Separator.size(), npos);
334 }
335
336 // Push the tail.
337 if (KeepEmpty || !S.empty())
338 A.push_back(S);
339}
340
341void StringRef::split(SmallVectorImpl<StringRef> &A, char Separator,
342 int MaxSplit, bool KeepEmpty) const {

Callers 15

varfilter.pyFile · 0.45
getHostCPUNameForARMMethod · 0.45
getHostCPUFeaturesMethod · 0.45
subMethod · 0.45
construct_yaml_intMethod · 0.45
construct_yaml_floatMethod · 0.45
typeHLA.jsFile · 0.45
bwa_postaltFunction · 0.45
typeHLA-selctg.jsFile · 0.45

Calls 5

findMethod · 0.45
push_backMethod · 0.45
sliceMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 6

testOutputMethod · 0.36
RunAndExtractTestListFunction · 0.36
GetTestsForAllIterationsFunction · 0.36
GetTestCasesFunction · 0.36