Bug 850466 - Do some trivial optimisations in mailnews/base/utils/folderUtils.jsm. r=mkmelin