Bunny83 / SimpleJSON

A simple JSON parser in C#
MIT License
735 stars 294 forks source link

"is" should be "==" #44

Closed tyster220 closed 3 years ago

tyster220 commented 3 years ago

https://github.com/Bunny83/SimpleJSON/blob/b0dd3c025ac89850f8e68835d519450a6fa37a12/SimpleJSON.cs#L366

Bunny83 commented 3 years ago

Well, since C#7 there is the constant support for the "is" operator. So this is still valid code. Though I personally prefer an ordinary == operatir in such cases. It turns out the null support in that method was added by someone else.

I probably will replace it with a ==, though it shouldn't be an issue with the latest C# syntax.

tyster220 commented 3 years ago

thanks 😄

my use case is in an older version of Unity (2018.2.15f1) with the scripting runtime version set to ".NET 3.5 Equivalent", so definitely not as up-to-date as I should be, haha.