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>
Several classes, particularly the ones related to translation services, have been modified to implement IDisposable interface. Additionally, all instances of HttpClient are being disposed properly now using "using" keyword. This will help ensure that system resources are promptly released when they're no longer required, potentially improving application performance and stability.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
This commit replaces explicit string variable declarations with the var keyword in the SpellCheckWordLists.cs file. This provides improved code readability and maintainability, as it leverages the compiler's ability to determine the variable's type automatically based on its value.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
This commit simplifies the process of loading user and system dictionaries in SpellCheckWordLists. The modified code avoids redundant loading constructs through an iteration over the dictionary paths. It contributes to maintaining the readability and efficiency of the codebase.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
The duplicated loops checking for words containing periods or dashes in different collections were replaced with a single loop. The function GetSingleUnifiedCollection was created to unify the collections using the Union method. This makes the code cleaner and more maintainable.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
Removed the '_skipAllList' variable from 'SpellCheckWordLists.cs' as it was unused. The variable was also removed from a sorting operation, which should help improve performance.
Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>