Countly / countly-sdk-unity

Countly Product Analytics Unity SDK
https://count.ly/mobile-analytics
MIT License
42 stars 30 forks source link

Refactoring in Countly.cs #227

Closed AliRKat closed 3 weeks ago

AliRKat commented 3 weeks ago

To reduce the number of warnings and increase the code readability, I did some refactoring Refactoring contains:

2 things need to be noted: 1- We can move this section:

if (configuration.GetServerUrl()[configuration.GetServerUrl().Length - 1] == '/') {
                configuration.ServerUrl = configuration.GetServerUrl().Remove(configuration.GetServerUrl().Length - 1);
            }

Into configuration. I believe there is no need to do it here. Since we also don't have a setter method for the server URL, this currently can't be refactored in this structure.

2- We moved away from initializing with prefab a long time ago. I planned to do that clean-up here, too, but it requires touching old configuration tests. We can move forward depending on you guys' decision.

AliRKat commented 3 weeks ago

[Unity] Refactoring in Countly.cs