mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07: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>
|
template<typename ...T>
|
||||||
static inline void expand(const Str &s, T &&...args) {
|
static inline void expand(const Str &s, T &&...args) {
|
||||||
char buf[64];
|
|
||||||
if (s.length() >= sizeof(buf)) return;
|
|
||||||
if (s.empty()) {
|
if (s.empty()) {
|
||||||
expand(std::forward<T>(args)..., (char *) nullptr);
|
expand(std::forward<T>(args)..., (char *) nullptr);
|
||||||
} else {
|
} else {
|
||||||
memcpy(buf, s.data(), s.length());
|
expand(std::forward<T>(args)..., std::string(s).data());
|
||||||
buf[s.length()] = '\0';
|
|
||||||
expand(std::forward<T>(args)..., buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user