pull: use ASSERT_PTR() to shorten code a tiny bit

This commit is contained in:
Lennart Poettering
2025-11-05 22:27:33 +01:00
parent 5bba33f5e9
commit 7aa847933f
2 changed files with 3 additions and 11 deletions

View File

@@ -500,13 +500,10 @@ static int raw_pull_rename_auxiliary_file(
}
static void raw_pull_job_on_finished(PullJob *j) {
RawPull *i;
int r;
assert(j);
assert(j->userdata);
i = j->userdata;
RawPull *i = ASSERT_PTR(j->userdata);
if (j->error != 0) {
/* Only the main job and the checksum job are fatal if they fail. The other fails are just

View File

@@ -399,13 +399,10 @@ static bool tar_pull_is_done(TarPull *i) {
}
static void tar_pull_job_on_finished(PullJob *j) {
TarPull *i;
int r;
assert(j);
assert(j->userdata);
i = j->userdata;
TarPull *i = ASSERT_PTR(j->userdata);
if (j->error != 0) {
clear_progress_bar(/* prefix= */ NULL);
@@ -582,13 +579,11 @@ finish:
static int tar_pull_job_on_open_disk_tar(PullJob *j) {
const char *where;
TarPull *i;
int r;
assert(j);
assert(j->userdata);
i = j->userdata;
TarPull *i = ASSERT_PTR(j->userdata);
assert(i->tar_job == j);
assert(!pidref_is_set(&i->tar_pid));
assert(i->tree_fd < 0);