[cleanup] check for existing strings directly
[cleanup] check for existing strings directly

- don't use "!=" operator if checking for an empty string
- don't use "elsif" or "else" if condition has a return statemant previously

Change-Id: Iaae83bbc3e98d84c0e2c55e9d9da0222b6919a7e

PersianWikipedia/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core