Quote:
Originally Posted by ownedbycats
That works! I was able to combine two if-thens that returned the same value:
Code:
if
select($identifiers, 'url')
&& !'Anthology' in $#fanficstatus
then
if
$publisher == 'Archive of Our Own'
&& !select($identifiers, 'ao3')
then 'metadata.png'
elif
$publisher == 'FanFiction.net'
&& !select($identifiers, 'ffnet')
then 'metadata.png'
fi
fi,
into this:
Code:
if
select($identifiers, 'url')
&& !'Anthology' in $#fanficstatus
then
if
($publisher == 'Archive of Our Own'
&& !select($identifiers, 'ao3'))
||
($publisher == 'FanFiction.net'
&& !select($identifiers, 'ffnet'))
then 'metadata.png'
fi
fi,
|
FWIW: if one of the (x && y) expressions occurs significantly more often than the other then it should be the first. The formatter does "shortcutting" where it stops evaluating when the result is known. If the first expression before the || returns true then the second expression isn't evaluated.