[IMPR] avois deeply nested flow control statements in ClaimCollection.toJSON()
[IMPR] avois deeply nested flow control statements in ClaimCollection.toJSON()

Change-Id: I7132e01141377a65842bcb55c6c83e4e114c5a56

wikimedia/pywikibot-core,wikimedia/pywikibot-core