Hi Jonathan, Thank you for your review and suggestion. The change looks great! Assigning a value with an immediate zero is indeed much faster.
in v2: * revised the commit message a little bit, I found it a little bit difficult to parse when re-reading it. * associated the commit with PR/libstdc++/109703. as I just filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109706, which turns out to be a dup of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109703 The rest of the v2 patch is identical to the one attached in your reply. Would you please taking another look? Kefu Chai (1): libstdc++: Set _M_string_length before calling _M_dispose() [PR109703] libstdc++-v3/include/bits/basic_string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.40.1