]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: avoid calling path_simplify() unnecessarilly for u.requires_mounts_for keys 20001/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 23 Jun 2021 15:32:15 +0000 (17:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 24 Jun 2021 08:59:45 +0000 (10:59 +0200)
commitac19bdd04b376c12787b75428bf3d6caf43805ff
tree2509a0ee4017545891ba134f479a3ab0b5b8f471
parent0fb789af20d2d76262472925229a6f45fe0f92b0
core: avoid calling path_simplify() unnecessarilly for u.requires_mounts_for keys

We would always call path_simplify() before doing a lookup, which requires the
path key to be duplicated first. But the hashmap lookup doesn't require this…
So let's opportunistically skip the allocation if the key is already present.

Inspired by https://github.com/systemd/systemd/pull/19973.
src/core/manager.c
src/core/unit.c