From f056ed2383265501f8d5ee2868100bb42f40b18a Mon Sep 17 00:00:00 2001 From: Ivandro Ismael Date: Sat, 8 Aug 2015 02:35:48 +0100 Subject: [PATCH] Break the loop whenever `found` is set to true --- src/Forms/Settings.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index c840229c5..00ae08de7 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -923,7 +923,10 @@ namespace Nikse.SubtitleEdit.Forms foreach (CultureInfo ci in cultures) { if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) + { found = true; + break; + } } if (!found) cultures.Add(culture); @@ -934,7 +937,10 @@ namespace Nikse.SubtitleEdit.Forms foreach (CultureInfo ci in cultures) { if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) + { found = true; + break; + } } if (!found) cultures.Add(culture); @@ -950,7 +956,10 @@ namespace Nikse.SubtitleEdit.Forms foreach (CultureInfo ci in cultures) { if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) + { found = true; + break; + } } if (!found) cultures.Add(culture); @@ -961,7 +970,10 @@ namespace Nikse.SubtitleEdit.Forms foreach (CultureInfo ci in cultures) { if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) + { found = true; + break; + } } if (!found) cultures.Add(culture);