diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/input/input_map.cpp | 2 | ||||
-rw-r--r-- | core/templates/paged_array.h | 20 |
2 files changed, 10 insertions, 12 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index 5a07d44197..b2e6b57eb6 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -344,7 +344,7 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = { { "ui_text_add_selection_for_next_occurrence", TTRC("Add Selection for Next Occurrence") }, { "ui_text_clear_carets_and_selection", TTRC("Clear Carets and Selection") }, { "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") }, - { "ui_text_submit", TTRC("Text Submitted") }, + { "ui_text_submit", TTRC("Submit Text") }, { "ui_graph_duplicate", TTRC("Duplicate Nodes") }, { "ui_graph_delete", TTRC("Delete Nodes") }, { "ui_filedialog_up_one_level", TTRC("Go Up One Level") }, diff --git a/core/templates/paged_array.h b/core/templates/paged_array.h index c447b5af64..45b90869b9 100644 --- a/core/templates/paged_array.h +++ b/core/templates/paged_array.h @@ -278,10 +278,10 @@ public: count -= remainder; - uint32_t src_pages = p_array._get_pages_in_use(); + uint32_t src_page_index = 0; uint32_t page_size = page_size_mask + 1; - for (uint32_t i = 0; i < src_pages; i++) { + while (p_array.count > 0) { uint32_t page_count = _get_pages_in_use(); uint32_t new_page_count = page_count + 1; @@ -289,16 +289,14 @@ public: _grow_page_array(); //keep out of inline } - page_data[page_count] = p_array.page_data[i]; - page_ids[page_count] = p_array.page_ids[i]; - if (i == src_pages - 1) { - //last page, only increment with remainder - count += p_array.count & page_size_mask; - } else { - count += page_size; - } + page_data[page_count] = p_array.page_data[src_page_index]; + page_ids[page_count] = p_array.page_ids[src_page_index]; + + uint32_t take = MIN(p_array.count, page_size); //pages to take away + p_array.count -= take; + count += take; + src_page_index++; } - p_array.count = 0; //take away the other array pages //handle the remainder page if exists if (remainder_page) { |