同步操作将从 OpenHarmony-SIG/python 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* stringlib: replace implementation */#ifndef STRINGLIB_FASTSEARCH_H#error must include "stringlib/fastsearch.h" before including this module#endifPy_LOCAL_INLINE(void)STRINGLIB(replace_1char_inplace)(STRINGLIB_CHAR* s, STRINGLIB_CHAR* end,Py_UCS4 u1, Py_UCS4 u2, Py_ssize_t maxcount){*s = u2;while (--maxcount && ++s != end) {/* Find the next character to be replaced.If it occurs often, it is faster to scan for it using an inlineloop. If it occurs seldom, it is faster to scan for it using afunction call; the overhead of the function call is amortizedacross the many characters that call covers. We start with aninline loop and use a heuristic to determine whether to fall backto a function call. */if (*s != u1) {int attempts = 10;/* search u1 in a dummy loop */while (1) {if (++s == end)return;if (*s == u1)break;if (!--attempts) {/* if u1 was not found for attempts iterations,use FASTSEARCH() or memchr() */#if STRINGLIB_SIZEOF_CHAR == 1s++;s = memchr(s, u1, end - s);if (s == NULL)return;#elsePy_ssize_t i;STRINGLIB_CHAR ch1 = (STRINGLIB_CHAR) u1;s++;i = FASTSEARCH(s, end - s, &ch1, 1, 0, FAST_SEARCH);if (i < 0)return;s += i;#endif/* restart the dummy loop */break;}}}*s = u2;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。