From 9a008c17ba404c3312d893fd09459f37d6b67a60 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 22 Mar 2024 16:47:48 -0700 Subject: [PATCH] Optimize for binary size --- native/src/sepolicy/api.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/native/src/sepolicy/api.cpp b/native/src/sepolicy/api.cpp index b23c0c460..a25dae883 100644 --- a/native/src/sepolicy/api.cpp +++ b/native/src/sepolicy/api.cpp @@ -55,14 +55,10 @@ static inline void expand(F &&f, T &&...args) { template static inline void expand(const Str &s, T &&...args) { - char buf[64]; - if (s.length() >= sizeof(buf)) return; if (s.empty()) { expand(std::forward(args)..., (char *) nullptr); } else { - memcpy(buf, s.data(), s.length()); - buf[s.length()] = '\0'; - expand(std::forward(args)..., buf); + expand(std::forward(args)..., std::string(s).data()); } }