mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 07:57:39 +00:00
Optimize for binary size
This commit is contained in:
parent
08dbf728a4
commit
9a008c17ba
@ -55,14 +55,10 @@ static inline void expand(F &&f, T &&...args) {
|
||||
|
||||
template<typename ...T>
|
||||
static inline void expand(const Str &s, T &&...args) {
|
||||
char buf[64];
|
||||
if (s.length() >= sizeof(buf)) return;
|
||||
if (s.empty()) {
|
||||
expand(std::forward<T>(args)..., (char *) nullptr);
|
||||
} else {
|
||||
memcpy(buf, s.data(), s.length());
|
||||
buf[s.length()] = '\0';
|
||||
expand(std::forward<T>(args)..., buf);
|
||||
expand(std::forward<T>(args)..., std::string(s).data());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user