filter: return on null filter from open and close

So that we don't have to include the if(filter) open_filter(filter)
block everywhere, we introduce the guard in the function itself. This
should simplify quite a bit of code.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Этот коммит содержится в:
Jason A. Donenfeld
2014-01-13 03:56:50 +01:00
родитель f43b228d0b
Коммит 800380dde7
4 изменённых файлов: 14 добавлений и 22 удалений

Просмотреть файл

@ -351,6 +351,8 @@ int cgit_open_filter(struct cgit_filter *filter, ...)
{
int result;
va_list ap;
if (!filter)
return 0;
va_start(ap, filter);
result = filter->open(filter, ap);
va_end(ap);
@ -359,6 +361,8 @@ int cgit_open_filter(struct cgit_filter *filter, ...)
int cgit_close_filter(struct cgit_filter *filter)
{
if (!filter)
return 0;
return filter->close(filter);
}