Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

Commit b861ce4

Browse files
committed
Merge pull request #133 from Dmitry-Me/removeEmptyLinesBeforeBuildingTheSet
Remove empty lines before building the set
2 parents b626f01 + d2abf39 commit b861ce4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CPPCheckPlugin/SuppressionsSettingsUI/ItemsListEditor.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public string Label
3333
public HashSet<string> Items
3434
{
3535
set { ItemsListText.Text = string.Join("\n", value); }
36-
get { return new HashSet<string>(ItemsListText.Text.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None)); }
36+
get {
37+
var text = ItemsListText.Text;
38+
var splitted = text.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
39+
return new HashSet<string>(splitted);
40+
}
3741
}
3842
}
3943
}

CPPCheckPlugin/SuppressionsSettingsUI/SuppressionsSettings.xaml.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ private void SaveClick(object sender, RoutedEventArgs e)
3131
SuppressionsInfo suppressionsInfo = new SuppressionsInfo();
3232

3333
suppressionsInfo.SuppressionLines = CppcheckLines.Items;
34-
while (suppressionsInfo.SuppressionLines.Remove("")) { /* nothing */ }
3534
suppressionsInfo.SkippedFilesMask = FilesLines.Items;
36-
while (suppressionsInfo.SkippedFilesMask.Remove("")) { /* nothing */ }
3735
suppressionsInfo.SkippedIncludesMask = IncludesLines.Items;
38-
while (suppressionsInfo.SkippedIncludesMask.Remove("")) { /* nothing */ }
3936

4037
suppressionsInfo.SaveToFile(suppressionsFilePath);
4138

0 commit comments

Comments
 (0)