The logic for adding names to either _namesMultiList or _namesList in the NameList class was spread widely in the method. It has now been encapsulated within a new private method called TryAdd. This commit leads to cleaner and clearer code within the class and promotes easier maintenance in the future.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
The XML document creation has been refactored into a separate function to reduce repetition. Prior code for creating the XML document was repeated in several places, specifically in the 'Remove' and 'Add' functions. The new 'CreateDocument' function now contains this code, making the overall codebase cleaner and easier to maintain.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
In the SpellCheckWordLists class, the redundant XML load operation in the 'else' clause has been removed. This change simplifies the code by getting rid of an unnecessary operation that was adding complexity and potentially slowing down the application.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
The condition check in the IfoParser class has been refactored for better readability and correctness. Proper grouping of conditions within parentheses has been added to ensure appropriate execution order.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
The GetAllLanguages function in IfoParser.cs has been updated to improve the calculation of the variable minCount. It now takes into consideration the count of three component lists - Subtitles, SubtitleIDs, and SubtitleTypes - ensuring that the loop operates on the smallest size among them. This modification prevents potential out-of-range errors.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
This commit optimizes the GetAllLanguages method within the IfoParser class. Instead of checking bounds within the loop, we calculate the minimum count between SubtitleIDs and SubtitleTypes before starting the iteration. This simplifies the logic and could potentially improve performance.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>