From b31b79c333cac70c5db87ea27bf0423c8acb21fd Mon Sep 17 00:00:00 2001 From: Xin Hu Date: Tue, 12 Jan 2016 15:06:02 -0500 Subject: [PATCH] ecma_get_chars_collection_length optimization JerryScript-DCO-1.0-Signed-off-by: Xin Hu Xin.A.Hu@intel.com --- jerry-core/ecma/base/ecma-helpers-string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jerry-core/ecma/base/ecma-helpers-string.cpp b/jerry-core/ecma/base/ecma-helpers-string.cpp index 4e637b988..5b19d33ae 100644 --- a/jerry-core/ecma/base/ecma-helpers-string.cpp +++ b/jerry-core/ecma/base/ecma-helpers-string.cpp @@ -144,7 +144,7 @@ ecma_get_chars_collection_length (const ecma_collection_header_t *header_p) /**< if (skip_bytes == 0) { skip_bytes = lit_get_unicode_char_size_by_utf8_first_byte (*cur_char_buf_iter_p); - length += (skip_bytes == 4) ? 2 : 1; + length++; skip_bytes--; } else