GROOVY-5858: 'string'.count('') fails (additional optimization)