mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Optimize json_escape_utf8 a bit by removing repeated calls to string methods
This commit is contained in:
parent
ee0619f999
commit
23f551876c
2 changed files with 26 additions and 22 deletions
|
@ -118,7 +118,7 @@ std::string extract_ip_and_len(const std::string& i, int* len);
|
|||
|
||||
inline void bytetohex(unsigned char byte, char* hex_out)
|
||||
{
|
||||
static const char hex_chars[] = "0123456789abcdef";
|
||||
static constexpr char hex_chars[] = "0123456789abcdef";
|
||||
hex_out[0] = hex_chars[(byte & 0xf0) >> 4];
|
||||
hex_out[1] = hex_chars[byte & 0x0f];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue