Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MarcosLopezC/LightJson
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.3
Choose a base ref
...
head repository: MarcosLopezC/LightJson
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 30, 2023

  1. Change null checks

    MarcosLopezC committed Sep 30, 2023
    Copy the full SHA
    204be91 View commit details
Showing with 9 additions and 9 deletions.
  1. +6 −6 Sources/LightJson/JsonValue.cs
  2. +3 −3 Sources/LightJson/Serialization/JsonReader.cs
12 changes: 6 additions & 6 deletions Sources/LightJson/JsonValue.cs
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ public bool IsDateTime
{
get
{
return this.AsDateTime != null;
return this.AsDateTime is not null;
}
}

@@ -437,7 +437,7 @@ public JsonValue(double? value)
/// <param name="value">The value to be wrapped.</param>
public JsonValue(string value)
{
if (value != null)
if (value is not null)
{
this.value = default(double);

@@ -457,7 +457,7 @@ public JsonValue(string value)
/// <param name="value">The value to be wrapped.</param>
public JsonValue(JsonObject value)
{
if (value != null)
if (value is not null)
{
this.value = default(double);

@@ -477,7 +477,7 @@ public JsonValue(JsonObject value)
/// <param name="value">The value to be wrapped.</param>
public JsonValue(JsonArray value)
{
if (value != null)
if (value is not null)
{
this.value = default(double);

@@ -546,7 +546,7 @@ public static implicit operator JsonValue(JsonArray value)
/// <param name="value">The value to be converted.</param>
public static implicit operator JsonValue(DateTime? value)
{
if (value == null)
if (value is null)
{
return JsonValue.Null;
}
@@ -781,7 +781,7 @@ public static JsonValue Parse(string text)
/// <param name="obj">The object to test.</param>
public override bool Equals(object obj)
{
if (obj == null)
if (obj is null)
{
return this.IsNull;
}
6 changes: 3 additions & 3 deletions Sources/LightJson/Serialization/JsonReader.cs
Original file line number Diff line number Diff line change
@@ -427,7 +427,7 @@ private JsonValue Parse()
/// <param name="reader">The TextReader used to read a JSON message.</param>
public static JsonValue Parse(TextReader reader)
{
if (reader == null)
if (reader is null)
{
throw new ArgumentNullException("reader");
}
@@ -441,7 +441,7 @@ public static JsonValue Parse(TextReader reader)
/// <param name="source">The string containing the JSON message.</param>
public static JsonValue Parse(string source)
{
if (source == null)
if (source is null)
{
throw new ArgumentNullException("source");
}
@@ -458,7 +458,7 @@ public static JsonValue Parse(string source)
/// <param name="path">The file path to be read.</param>
public static JsonValue ParseFile(string path)
{
if (path == null)
if (path is null)
{
throw new ArgumentNullException("path");
}