mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
cgroup-util: check unified_cache before invoking streq()
Just a minor optimization.
This commit is contained in:
parent
ecc0eab247
commit
fc9ae7178e
@ -2340,10 +2340,13 @@ bool cg_unified(const char *controller) {
|
||||
|
||||
assert(cg_update_unified() >= 0);
|
||||
|
||||
if (streq_ptr(controller, SYSTEMD_CGROUP_CONTROLLER))
|
||||
return unified_cache >= CGROUP_UNIFIED_SYSTEMD;
|
||||
else
|
||||
return unified_cache >= CGROUP_UNIFIED_ALL;
|
||||
if (unified_cache == CGROUP_UNIFIED_NONE)
|
||||
return false;
|
||||
|
||||
if (unified_cache >= CGROUP_UNIFIED_ALL)
|
||||
return true;
|
||||
|
||||
return streq_ptr(controller, SYSTEMD_CGROUP_CONTROLLER);
|
||||
}
|
||||
|
||||
bool cg_all_unified(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user