Misc QoL changes

- su: Preserve correct capacity to avoid vector reallocation
- su: Properly format code
- daemon: Remove useless `if`
- docs: Remove outdated info
This commit is contained in:
canyie
2022-04-29 23:44:02 +08:00
committed by John Wu
parent e88eed9a8d
commit 4f1a1879e5
6 changed files with 11 additions and 15 deletions

View File

@@ -189,7 +189,7 @@ void app_log(const su_context &ctx) {
void app_notify(const su_context &ctx) {
if (fork_dont_care() == 0) {
vector<Extra> extras;
extras.reserve(2);
extras.reserve(3);
extras.emplace_back("from.uid", ctx.info->uid);
extras.emplace_back("pid", ctx.pid);
extras.emplace_back("policy", ctx.info->access.policy);
@@ -210,7 +210,7 @@ int app_request(const su_context &ctx) {
// Send request
vector<Extra> extras;
extras.reserve(2);
extras.reserve(3);
extras.emplace_back("fifo", fifo);
extras.emplace_back("uid", ctx.info->eval_uid);
extras.emplace_back("pid", ctx.pid);