Skip to content

Commit aa993b1

Browse files
committed
fix: removes unnecessary null prop in copy constructor
Signed-off-by: Vincent Biret <[email protected]>
1 parent 376e54d commit aa993b1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Microsoft.OpenApi/Models/References/OpenApiCallbackReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public OpenApiCallbackReference(string referenceId, OpenApiDocument hostDocument
6969
public OpenApiCallbackReference(OpenApiCallbackReference callback)
7070
{
7171
Utils.CheckArgumentNull(callback);
72-
Reference = callback?.Reference != null ? new(callback.Reference) : null;
73-
UnresolvedReference = callback?.UnresolvedReference ?? false;
72+
Reference = callback.Reference != null ? new(callback.Reference) : null;
73+
UnresolvedReference = callback.UnresolvedReference;
7474
}
7575

7676
internal OpenApiCallbackReference(OpenApiCallback target, string referenceId)

src/Microsoft.OpenApi/Models/References/OpenApiExampleReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public OpenApiExampleReference(string referenceId, OpenApiDocument hostDocument,
6767
public OpenApiExampleReference(OpenApiExampleReference example)
6868
{
6969
Utils.CheckArgumentNull(example);
70-
Reference = example?.Reference != null ? new(example.Reference) : null;
71-
UnresolvedReference = example?.UnresolvedReference ?? false;
70+
Reference = example.Reference != null ? new(example.Reference) : null;
71+
UnresolvedReference = example.UnresolvedReference;
7272
//no need to copy summary and description as if they are not overridden, they will be fetched from the target
7373
//if they are, the reference copy will handle it
7474
}

src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public OpenApiLinkReference(OpenApiLinkReference reference)
6565
{
6666
Utils.CheckArgumentNull(reference);
6767

68-
Reference = reference?.Reference != null ? new(reference.Reference) : null;
69-
UnresolvedReference = reference?.UnresolvedReference ?? false;
68+
Reference = reference.Reference != null ? new(reference.Reference) : null;
69+
UnresolvedReference = reference.UnresolvedReference;
7070
//no need to copy summary and description as if they are not overridden, they will be fetched from the target
7171
//if they are, the reference copy will handle it
7272
}

0 commit comments

Comments
 (0)