Skip to content

Commit afcbcb5

Browse files
author
jaime-m-p
committed
Using vector instead of array
1 parent d96afa7 commit afcbcb5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

unicode.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <unordered_set>
1313
#include <utility>
1414
#include <vector>
15-
#include <array>
1615
#include <locale>
1716
#include <codecvt>
1817

@@ -110,9 +109,8 @@ static uint32_t unicode_cpt_from_utf8(const std::string & utf8, size_t & offset)
110109
// return result;
111110
//}
112111

113-
static std::array<int, MAX_CODEPOINTS> unicode_cpt_type_map() {
114-
std::array<int, MAX_CODEPOINTS> cpt_types;
115-
cpt_types.fill(CODEPOINT_TYPE_UNIDENTIFIED);
112+
static std::vector<int> unicode_cpt_type_map() {
113+
std::vector<int> cpt_types((size_t)MAX_CODEPOINTS, CODEPOINT_TYPE_UNIDENTIFIED);
116114
for (auto p : unicode_ranges_number) {
117115
for (auto i = p.first; i <= p.second; ++i) {
118116
cpt_types[i] = CODEPOINT_TYPE_NUMBER;

0 commit comments

Comments
 (0)