mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Clean up more code using "(expr) ? true : false"
This is similar to fd0625c
, taking care of any remaining code paths that
are worth the cleanup. This also changes some cases using opposite
expression patterns.
Author: Justin Pryzby, Masahiko Sawada
Discussion: https://postgr.es/m/CAD21AoCdF8dnUvr-BUWWGvA_XhKSoANacBMZb6jKyCk4TYfQ2Q@mail.gmail.com
This commit is contained in:
@ -91,42 +91,42 @@ Datum
|
||||
ltree_lt(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res < 0) ? true : false);
|
||||
PG_RETURN_BOOL(res < 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
ltree_le(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res <= 0) ? true : false);
|
||||
PG_RETURN_BOOL(res <= 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
ltree_eq(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res == 0) ? true : false);
|
||||
PG_RETURN_BOOL(res == 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
ltree_ge(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res >= 0) ? true : false);
|
||||
PG_RETURN_BOOL(res >= 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
ltree_gt(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res > 0) ? true : false);
|
||||
PG_RETURN_BOOL(res > 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
ltree_ne(PG_FUNCTION_ARGS)
|
||||
{
|
||||
RUNCMP;
|
||||
PG_RETURN_BOOL((res != 0) ? true : false);
|
||||
PG_RETURN_BOOL(res != 0);
|
||||
}
|
||||
|
||||
Datum
|
||||
|
Reference in New Issue
Block a user