From 9fc76a7dea5409078b2890bd9525f1498d8f9fff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 15 Aug 2019 08:09:38 -0400 Subject: [PATCH] DNAYaml: Use std::string_view instead of std::string for base64 characters Eliminates a runtime static constructor that needs to execute. Also gets rid of a heap allocation. --- src/athena/DNAYaml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/athena/DNAYaml.cpp b/src/athena/DNAYaml.cpp index 43997ee..799fac6 100644 --- a/src/athena/DNAYaml.cpp +++ b/src/athena/DNAYaml.cpp @@ -1003,7 +1003,7 @@ bool YAMLDocWriter::RecursiveFinish(yaml_emitter_t* doc, const YAMLNode& node) { return true; } -static const std::string base64_chars = +constexpr std::string_view base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/";