python split 28 29 source code

Solutions on MaxInterview for python split 28 29 source code by the best coders in the world

showing results for - "python split 28 29 source code"
Candice
27 Jan 2020
1i = j = 0;
2while (maxcount-- > 0) {
3    /* Increment counter past all leading whitespace in 
4       the string. */
5    while (i < str_len && STRINGLIB_ISSPACE(str[i]))
6        i++;
7    /* if string only contains whitespace, break. */
8    if (i == str_len) break;
9
10    /* After leading white space, increment counter 
11       while the character is not a whitespace. 
12       If this ends before i == str_len, it points to 
13       a white space character. */
14    j = i; i++;
15    while (i < str_len && !STRINGLIB_ISSPACE(str[i]))
16        i++;
17#ifndef STRINGLIB_MUTABLE
18    /* Case where no split should be done, return the string. */
19    if (j == 0 && i == str_len && STRINGLIB_CHECK_EXACT(str_obj)) {
20        /* No whitespace in str_obj, so just use it as list[0] */
21        Py_INCREF(str_obj);
22        PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
23        count++;
24        break;
25    }
26#endif
27    /* Make the split based on the incremented counters. */
28    SPLIT_ADD(str, j, i);
29}