diff --git a/fileFinder/MainForm.cs b/fileFinder/MainForm.cs index fa04b18..435ec7e 100644 --- a/fileFinder/MainForm.cs +++ b/fileFinder/MainForm.cs @@ -123,13 +123,9 @@ namespace fileFinder private bool isFileContainQuery (string[] fileLines, string query) { - int count = 0; - while (fileLines.Length > count) - if (fileLines[count].IndexOf(query) != -1) - { + foreach (string item in fileLines) + if (item.IndexOf(query) != -1) return true; - } - count++; return false; }