From 2d946020ff7448198e87457f9665035bdaff142c Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 27 Jun 2024 16:16:04 +0100 Subject: [PATCH 1/2] Remove GC.SuppressFinalize(this) on class that doesn't implement finalizer Signed-off-by: Ivandro Jao --- src/libse/ContainerFormats/Matroska/MatroskaFile.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libse/ContainerFormats/Matroska/MatroskaFile.cs b/src/libse/ContainerFormats/Matroska/MatroskaFile.cs index 40941ac9f..aa98710b8 100644 --- a/src/libse/ContainerFormats/Matroska/MatroskaFile.cs +++ b/src/libse/ContainerFormats/Matroska/MatroskaFile.cs @@ -671,11 +671,7 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Matroska return _subtitleRip; } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } + public void Dispose() => Dispose(true); private void Dispose(bool disposing) { @@ -686,7 +682,6 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Matroska } } - private void ReadSegmentInfoAndTracks() { // go to segment From aa7b5b8b51e244390dcd0dc2fbbd5e51ef7d4bd6 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 27 Jun 2024 16:17:45 +0100 Subject: [PATCH 2/2] Refactor variable naming in MatroskaFile Updated the variable 'ChapterDisplay' to 'chapterDisplay' in the 'GetChapterName' method of the 'MatroskaFile.cs' file. This change adheres to the standard naming convention increasing code readability and maintainability. Signed-off-by: Ivandro Jao --- src/libse/ContainerFormats/Matroska/MatroskaFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libse/ContainerFormats/Matroska/MatroskaFile.cs b/src/libse/ContainerFormats/Matroska/MatroskaFile.cs index aa98710b8..c040f4761 100644 --- a/src/libse/ContainerFormats/Matroska/MatroskaFile.cs +++ b/src/libse/ContainerFormats/Matroska/MatroskaFile.cs @@ -520,10 +520,10 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Matroska } } - private string GetChapterName(Element ChapterDisplay) + private string GetChapterName(Element chapterDisplay) { Element element; - while (_stream.Position < ChapterDisplay.EndPosition && (element = ReadElement()) != null) + while (_stream.Position < chapterDisplay.EndPosition && (element = ReadElement()) != null) { if (element.Id == ElementId.ChapString) {