[systemd-devel] [PATCH 1/1] sd-journal: consistently use ternany for all direction checks

Lennart Poettering lennart at poettering.net
Mon Oct 20 13:03:54 PDT 2014


On Mon, 13.10.14 22:12, Christian Hesse (list at eworm.de) wrote:

> From: Christian Hesse <mail at eworm.de>

Not that this would matter much, but I merged it anyway.

Thanks!

> 
> ---
>  src/journal/sd-journal.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
> index 479444c..daa04ac 100644
> --- a/src/journal/sd-journal.c
> +++ b/src/journal/sd-journal.c
> @@ -849,10 +849,8 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
>                          int k;
>  
>                          k = compare_with_location(f, c, &j->current_location);
> -                        if (direction == DIRECTION_DOWN)
> -                                found = k > 0;
> -                        else
> -                                found = k < 0;
> +
> +                        found = direction == DIRECTION_DOWN ? k > 0 : k < 0;
>                  } else
>                          found = true;
>  
> -- 
> 2.1.2
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list