From fe38244d7c0afebcde88e053c58bfb250d3d8798 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 2 Jun 2018 19:31:07 +0200 Subject: [PATCH] Micro optimisation. --- m-string.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/m-string.h b/m-string.h index 35c7bc15..e5ee6020 100644 --- a/m-string.h +++ b/m-string.h @@ -1144,8 +1144,13 @@ string_utf8_p(string_t str) char c = string_get_char(str, i); \ if (c == sep) { \ string_set_strn(tmp, &str->ptr[begin], i - begin); \ - /* TODO: PUSH_MOVE will be better if available (or PUSH_NEW) */ \ - M_GET_PUSH oplist (cont, tmp); \ + /* If push move method is available, use it */ \ + M_IF_METHOD(PUSH_MOVE,oplist)( \ + M_GET_PUSH_MOVE oplist (cont, &tmp); \ + string_init(tmp); \ + , \ + M_GET_PUSH oplist (cont, tmp); \ + ) \ begin = i + 1; \ } \ } \