Skip to content

Commit 8bcb129

Browse files
committed
Review tweaks
1 parent 3e9b694 commit 8bcb129

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/tree.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ void
5151
TreeEntry_dealloc(TreeEntry *self)
5252
{
5353
git_tree_entry_free((git_tree_entry*)self->entry);
54-
if (self->repo) {
55-
Py_CLEAR(self->repo);
56-
}
54+
Py_CLEAR(self->repo);
5755
PyObject_Del(self);
5856
}
5957

@@ -506,11 +504,8 @@ wrap_tree_entry(const git_tree_entry *entry, Repository *repo)
506504
if (py_entry)
507505
{
508506
py_entry->entry = entry;
509-
if (repo)
510-
{
511-
py_entry->repo = repo;
512-
Py_INCREF(repo);
513-
}
507+
py_entry->repo = repo; // can be NULL
508+
Py_XINCREF(repo);
514509
}
515510

516511
return py_entry;

0 commit comments

Comments
 (0)