Skip to content

Commit 403ee78

Browse files
Fix coding style
1 parent b4ee855 commit 403ee78

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

runtime/strings/bytes.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <algorithm>
2+
#include <array> // Add this include for std::array
23
#include <cstdint>
34
#include <cstdlib>
45
#include <cstring>
56
#include <gmp.h>
67
#include <stdexcept>
78
#include <unordered_set>
8-
#include <array> // Add this include for std::array
99

1010
#include "runtime/alloc.h"
1111
#include "runtime/header.h"
@@ -164,9 +164,11 @@ SortBytes hook_BYTES_string2bytes(SortString s) {
164164
}
165165

166166
string *bytes2hexstring(string *b, size_t len) {
167-
static const std::array<char, 16> hexchars = {'0', '1', '2', '3', '4', '5', '6', '7',
168-
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
169-
auto *result = static_cast<string *>(kore_alloc_token(sizeof(string) + len * 2));
167+
static const std::array<char, 16> hexchars
168+
= {'0', '1', '2', '3', '4', '5', '6', '7',
169+
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
170+
auto *result
171+
= static_cast<string *>(kore_alloc_token(sizeof(string) + len * 2));
170172
for (size_t i = 0; i < len; i++) {
171173
result->data[i * 2] = hexchars.at((b->data[i] >> 4) & 0xf);
172174
result->data[i * 2 + 1] = hexchars.at(b->data[i] & 0xf);

0 commit comments

Comments
 (0)