Skip to content

Commit

Permalink
Rename AttNames.andIf to alsoIf
Browse files Browse the repository at this point in the history
The name andIf could be misread as suggesting some kind of
boolean dependency on what went before, when really each
alsoIf only cares about its own predicate.
  • Loading branch information
jcflack committed Sep 9, 2023
1 parent d1e1db3 commit cb71f38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ public String toString()
* attribute names that may be conditional (on something like
* {@code PG_VERSION_NUM}).
*<p>
* {@code andIf} adds strings to the list, if the condition is true, or
* {@code alsoIf} adds strings to the list, if the condition is true, or
* the same number of nulls of the condition is false.
*<p>
* {@code project} filters the list to only the non-null values, using
Expand All @@ -920,7 +920,7 @@ static class AttNames implements Iterator<Attribute>
private Projection it;
private Iterator<Attribute> itsItr;

AttNames andIf(boolean p, String... toAdd)
AttNames alsoIf(boolean p, String... toAdd)
{
if ( p )
for ( String s : toAdd )
Expand Down Expand Up @@ -982,7 +982,7 @@ public Attribute next()
*/
static AttNames attNames(String... names)
{
return new AttNames().andIf(true, names);
return new AttNames().alsoIf(true, names);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static class Att
"probin",
"proconfig",
"proargdefaults"
).andIf(PG_VERSION_NUM >= 140000,
).alsoIf(PG_VERSION_NUM >= 140000,
"prosqlbody"
).project(CLASSID.tupleDescriptor());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ static class Att
"typcollation",
"typdefault",
"typdefaultbin"
).andIf(PG_VERSION_NUM >= 140000,
).alsoIf(PG_VERSION_NUM >= 140000,
"typsubscript"
).project(CLASSID.tupleDescriptor());

Expand Down

0 comments on commit cb71f38

Please sign in to comment.