mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
Clean up some code using "(expr) ? true : false"
All the code paths simplified here were already using a boolean or used an expression that led to zero or one, making the extra bits unnecessary. Author: Justin Pryzby Reviewed-by: Tom Lane, Michael Paquier, Peter Smith Discussion: https://postgr.es/m/20210428182936.GE27406@telsasoft.com
This commit is contained in:
@@ -241,7 +241,7 @@ dataIsMoveRight(GinBtree btree, Page page)
|
||||
if (GinPageIsDeleted(page))
|
||||
return true;
|
||||
|
||||
return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? true : false;
|
||||
return (ginCompareItemPointers(&btree->itemptr, iptr) > 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -100,7 +100,7 @@ initGinState(GinState *state, Relation index)
|
||||
MemSet(state, 0, sizeof(GinState));
|
||||
|
||||
state->index = index;
|
||||
state->oneCol = (origTupdesc->natts == 1) ? true : false;
|
||||
state->oneCol = (origTupdesc->natts == 1);
|
||||
state->origTupdesc = origTupdesc;
|
||||
|
||||
for (i = 0; i < origTupdesc->natts; i++)
|
||||
|
Reference in New Issue
Block a user