Lines Matching refs:self_len

243     Py_ssize_t self_len, result_len;  in stringlib_replace_interleave()  local
247 self_len = STRINGLIB_LEN(self); in stringlib_replace_interleave()
251 if (maxcount <= self_len) { in stringlib_replace_interleave()
256 count = self_len + 1; in stringlib_replace_interleave()
262 if (to_len > (PY_SSIZE_T_MAX - self_len) / count) { in stringlib_replace_interleave()
267 result_len = count * to_len + self_len; in stringlib_replace_interleave()
300 memcpy(result_s, self_s, self_len - i); in stringlib_replace_interleave()
313 Py_ssize_t self_len, result_len; in stringlib_replace_delete_single_character() local
317 self_len = STRINGLIB_LEN(self); in stringlib_replace_delete_single_character()
320 count = countchar(self_s, self_len, from_c, maxcount); in stringlib_replace_delete_single_character()
325 result_len = self_len - count; /* from_len == 1 */ in stringlib_replace_delete_single_character()
335 end = self_s + self_len; in stringlib_replace_delete_single_character()
358 Py_ssize_t self_len, result_len; in stringlib_replace_delete_substring() local
362 self_len = STRINGLIB_LEN(self); in stringlib_replace_delete_substring()
365 count = stringlib_count(self_s, self_len, in stringlib_replace_delete_substring()
374 result_len = self_len - (count * from_len); in stringlib_replace_delete_substring()
384 end = self_s + self_len; in stringlib_replace_delete_substring()
410 Py_ssize_t self_len; in stringlib_replace_single_character_in_place() local
415 self_len = STRINGLIB_LEN(self); in stringlib_replace_single_character_in_place()
417 next = findchar(self_s, self_len, from_c); in stringlib_replace_single_character_in_place()
425 result = STRINGLIB_NEW(NULL, self_len); in stringlib_replace_single_character_in_place()
430 memcpy(result_s, self_s, self_len); in stringlib_replace_single_character_in_place()
436 end = result_s + self_len; in stringlib_replace_single_character_in_place()
458 Py_ssize_t self_len, offset; in stringlib_replace_substring_in_place() local
464 self_len = STRINGLIB_LEN(self); in stringlib_replace_substring_in_place()
466 offset = stringlib_find(self_s, self_len, in stringlib_replace_substring_in_place()
475 result = STRINGLIB_NEW(NULL, self_len); in stringlib_replace_substring_in_place()
480 memcpy(result_s, self_s, self_len); in stringlib_replace_substring_in_place()
486 end = result_s + self_len; in stringlib_replace_substring_in_place()
510 Py_ssize_t self_len, result_len; in stringlib_replace_single_character() local
515 self_len = STRINGLIB_LEN(self); in stringlib_replace_single_character()
517 count = countchar(self_s, self_len, from_c, maxcount); in stringlib_replace_single_character()
526 if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) { in stringlib_replace_single_character()
530 result_len = self_len + count * (to_len - 1); in stringlib_replace_single_character()
539 end = self_s + self_len; in stringlib_replace_single_character()
574 Py_ssize_t self_len, result_len; in stringlib_replace_substring() local
579 self_len = STRINGLIB_LEN(self); in stringlib_replace_substring()
581 count = stringlib_count(self_s, self_len, in stringlib_replace_substring()
593 if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) { in stringlib_replace_substring()
597 result_len = self_len + count * (to_len - from_len); in stringlib_replace_substring()
606 end = self_s + self_len; in stringlib_replace_substring()