]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/job: mark job_type_lookup_merge() and _is_redundant() as const
authorMike Yuan <me@yhndnzj.com>
Wed, 22 Oct 2025 18:50:17 +0000 (20:50 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 4 Nov 2025 11:17:29 +0000 (12:17 +0100)
They don't take pointers, hence are eligible for stronger guarantees.

src/core/job.h

index d8be0b652eb1bfbe0b6a93cad9d61e3cef3f2d85..028281eb5fc18f29f7e8413de6c53e2d8db14094 100644 (file)
@@ -162,7 +162,7 @@ int job_coldplug(Job *j);
 JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts);
 void job_dependency_free(JobDependency *l);
 
-JobType job_type_lookup_merge(JobType a, JobType b) _pure_;
+JobType job_type_lookup_merge(JobType a, JobType b) _const_;
 
 _pure_ static inline bool job_type_is_mergeable(JobType a, JobType b) {
         return job_type_lookup_merge(a, b) >= 0;
@@ -181,7 +181,7 @@ _pure_ static inline bool job_type_is_superset(JobType a, JobType b) {
         return a == job_type_lookup_merge(a, b);
 }
 
-bool job_type_is_redundant(JobType a, UnitActiveState b) _pure_;
+bool job_type_is_redundant(JobType a, UnitActiveState b) _const_;
 
 /* Collapses a state-dependent job type into a simpler type by observing
  * the state of the unit which it is going to be applied to. */