void (final Map<String, Set<PsiFile>> processedTextToFiles, final String text, final Map<String, Set<PsiFile>> processedFoundTextToFiles, final PsiSearchHelper searchHelper, final GlobalSearchScope scope) { if (!processedTextToFiles.containsKey(text)) { if (processedFoundTextToFiles.containsKey(text)) { final Set<PsiFile> filesWithValue = processedFoundTextToFiles.get(text); processedTextToFiles.put(text, filesWithValue); } else { final Set<PsiFile> resultFiles = new HashSet<>(); findFilesWithText(text, searchHelper, scope, resultFiles); if (resultFiles.isEmpty()) return; processedTextToFiles.put(text, resultFiles); } } }