View Single Post
Old 01-22-2023, 03:30 PM   #487
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
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.
chaley is offline   Reply With Quote