comparison src/change.c @ 34518:80991201ed38 v9.1.0163

patch 9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed Commit: https://github.com/vim/vim/commit/82e079df814f7372e9579450730062b205449efa Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Mar 10 08:55:42 2024 +0100 patch 9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed Problem: Calling STRLEN() to compute ml_line_textlen when not needed. Solution: Use 0 when STRLEN() will be required and call STRLEN() later. (zeertzjq) closes: #14155 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Mar 2024 09:00:08 +0100
parents 67674e379c26
children 64edf95a833a
comparison
equal deleted inserted replaced
34517:6358e85e21e3 34518:80991201ed38
1362 // Also move any following text properties. 1362 // Also move any following text properties.
1363 if (oldlen + 1 < curbuf->b_ml.ml_line_len) 1363 if (oldlen + 1 < curbuf->b_ml.ml_line_len)
1364 mch_memmove(newp + newlen + 1, oldp + oldlen + 1, 1364 mch_memmove(newp + newlen + 1, oldp + oldlen + 1,
1365 (size_t)curbuf->b_ml.ml_line_len - oldlen - 1); 1365 (size_t)curbuf->b_ml.ml_line_len - oldlen - 1);
1366 curbuf->b_ml.ml_line_len -= count; 1366 curbuf->b_ml.ml_line_len -= count;
1367 curbuf->b_ml.ml_line_textlen = (int)STRLEN(newp) + 1; 1367 curbuf->b_ml.ml_line_textlen = 0;
1368 } 1368 }
1369 #endif 1369 #endif
1370 1370
1371 // mark the buffer as changed and prepare for displaying 1371 // mark the buffer as changed and prepare for displaying
1372 inserted_bytes(lnum, col, -count); 1372 inserted_bytes(lnum, col, -count);