mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
util: place a couple of _likely_ around cache TLS vars
This commit is contained in:
parent
b636465bc0
commit
3bfc71846c
@ -488,7 +488,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
|
||||
assert(controller);
|
||||
assert(fs);
|
||||
|
||||
if (!good) {
|
||||
if (_unlikely_(!good)) {
|
||||
int r;
|
||||
|
||||
r = path_is_mount_point("/sys/fs/cgroup");
|
||||
|
@ -73,7 +73,7 @@ size_t page_size(void) {
|
||||
static __thread size_t pgsz = 0;
|
||||
long r;
|
||||
|
||||
if (pgsz)
|
||||
if (_likely_(pgsz))
|
||||
return pgsz;
|
||||
|
||||
assert_se((r = sysconf(_SC_PAGESIZE)) > 0);
|
||||
@ -3768,7 +3768,7 @@ int columns(void) {
|
||||
static __thread int parsed_columns = 0;
|
||||
const char *e;
|
||||
|
||||
if (parsed_columns > 0)
|
||||
if (_likely_(parsed_columns > 0))
|
||||
return parsed_columns;
|
||||
|
||||
if ((e = getenv("COLUMNS")))
|
||||
@ -4364,7 +4364,7 @@ int detect_virtualization(const char **id) {
|
||||
const char *_id;
|
||||
int r;
|
||||
|
||||
if (cached_id) {
|
||||
if (_likely_(cached_id)) {
|
||||
|
||||
if (cached_id == (const char*) -1)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user