From ec1f5dc317182582ebff843c9e8a4d5277405469 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 6 Jan 2019 21:50:43 +0100 Subject: Mayor code cleanup Add Argument*Exceptions now use proper nameof operators. Added exception messages to quite a few Argument*Exceptions. Fixed rethorwing to be proper syntax. Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling) Added some TODOs to log certain exceptions. Fix sln again. Fixed all AssemblyInfo's and added proper copyright (where I could find them) We live in *current year*. Fixed the use of braces. Fixed a ton of properties, and made a fair amount of functions static that should be and can be static. Made more Methods that should be static static. You can now use static to find bad functions! Removed unused variable. And added one more proper XML comment. --- .../UniversalDetector/Core/SequenceModel.cs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs') diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs index 9048796b5..32b5df169 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs @@ -52,29 +52,23 @@ namespace UniversalDetector.Core // freqSeqs / totalSeqs protected float typicalPositiveRatio; - public float TypicalPositiveRatio { - get { return typicalPositiveRatio; } - } - + public float TypicalPositiveRatio => typicalPositiveRatio; + // not used protected bool keepEnglishLetter; - public bool KeepEnglishLetter { - get { return keepEnglishLetter; } - } - - protected String charsetName; + public bool KeepEnglishLetter => keepEnglishLetter; + + protected string charsetName; + + public string CharsetName => charsetName; - public string CharsetName { - get { return charsetName; } - } - public SequenceModel( byte[] charToOrderMap, byte[] precedenceMatrix, float typicalPositiveRatio, bool keepEnglishLetter, - String charsetName) + string charsetName) { this.charToOrderMap = charToOrderMap; this.precedenceMatrix = precedenceMatrix; -- cgit v1.2.3