Skip to content

Commit 8792f47

Browse files
committed
dotnet format
1 parent 02d3571 commit 8792f47

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

Datamodel.NET/Arrays.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ internal set
181181
if (elem.Owner == null)
182182
{
183183
var importedElement = OwnerDatamodel.ImportElement(elem, Datamodel.ImportRecursionMode.Stubs, Datamodel.ImportOverwriteMode.Stubs);
184-
185-
if(importedElement is not null)
184+
185+
if (importedElement is not null)
186186
{
187187
Inner[i] = importedElement;
188188
}
@@ -201,8 +201,8 @@ protected override void Insert_Internal(int index, Element item)
201201
if (item.Owner == null)
202202
{
203203
var importedElement = OwnerDatamodel.ImportElement(item, Datamodel.ImportRecursionMode.Recursive, Datamodel.ImportOverwriteMode.Stubs);
204-
205-
if(importedElement is not null)
204+
205+
if (importedElement is not null)
206206
{
207207
item = importedElement;
208208
}

Datamodel.NET/AttributeList.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private ICollection<Attribute> GetPropertyBasedAttributes(bool useSerializationN
2929
var result = new List<Attribute>();
3030
foreach (DictionaryEntry entry in PropertyInfos)
3131
{
32-
if(entry.Value is null)
32+
if (entry.Value is null)
3333
{
3434
throw new InvalidDataException("Property value can not be null");
3535
}
@@ -135,7 +135,7 @@ public void Add(string key, object? value)
135135
{
136136
var attrib = Inner[key];
137137

138-
if(attrib is null)
138+
if (attrib is null)
139139
{
140140
return null;
141141
}
@@ -269,7 +269,7 @@ public virtual object? this[string name]
269269
{
270270
// were actually fine with this being null, it will just set the value to null
271271
// but need to check so the type check doesn't fail if it is null
272-
if(value != null)
272+
if (value != null)
273273
{
274274
var valueType = value.GetType();
275275

@@ -307,7 +307,7 @@ public virtual object? this[string name]
307307

308308
return;
309309
}
310-
310+
311311
Attribute? old_attr;
312312
Attribute? new_attr;
313313
int old_index = -1;
@@ -343,7 +343,7 @@ public AttrKVP this[int index]
343343
{
344344
var attr = (Attribute?)Inner[index];
345345

346-
if(attr is null)
346+
if (attr is null)
347347
{
348348
throw new InvalidOperationException($"attribute at index {index} doesn't exist");
349349
}
@@ -367,7 +367,7 @@ public void RemoveAt(int index)
367367
{
368368
attr = (Attribute?)Inner[index];
369369

370-
if(attr is not null)
370+
if (attr is not null)
371371
{
372372
attr.Owner = null;
373373
Inner.RemoveAt(index);
@@ -571,7 +571,7 @@ public static ValueComparer Default
571571

572572
public new bool Equals(object? x, object? y)
573573
{
574-
if(x is null || y is null)
574+
if (x is null || y is null)
575575
{
576576
return false;
577577
}

Datamodel.NET/Codecs/Binary.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public Datamodel Decode(string encoding, int encoding_version, string format, in
414414

415415
public object? DeferredDecodeAttribute(Datamodel dm, long offset)
416416
{
417-
if(Reader is null)
417+
if (Reader is null)
418418
{
419419
throw new InvalidDataException("Tried to read a deferred attribute but the reader is invalid");
420420
}
@@ -449,7 +449,7 @@ void SkipAttribute(BinaryReader reader)
449449
int count = 1;
450450
Type? type = types.Item1;
451451

452-
if(type is null)
452+
if (type is null)
453453
{
454454
throw new InvalidDataException("Failed to match id to type");
455455
}
@@ -554,7 +554,7 @@ public void Encode()
554554

555555
int CountChildren(Element? elem, HashSet<Element> counter)
556556
{
557-
if(elem is null)
557+
if (elem is null)
558558
{
559559
return 0;
560560
}

Datamodel.NET/Codecs/KeyValues2.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void Flush()
137137

138138
void CountReferences(Element? elem)
139139
{
140-
if(elem is null)
140+
if (elem is null)
141141
{
142142
return;
143143
}
@@ -309,7 +309,7 @@ void WriteAttribute(string name, int encodingVersion, Type type, object value, b
309309

310310
private bool ShouldBeReferenced(Element? elem)
311311
{
312-
if(elem is null)
312+
if (elem is null)
313313
{
314314
return false;
315315
}
@@ -336,7 +336,7 @@ void WriteElement(Element element, int encodingVersion, KV2Writer writer)
336336

337337
foreach (var attr in element.GetAllAttributesForSerialization())
338338
{
339-
if (attr.Value != null)
339+
if (attr.Value != null)
340340
WriteAttribute(attr.Key, encodingVersion, attr.Value.GetType(), attr.Value, false, writer);
341341
}
342342

@@ -362,7 +362,7 @@ public void Encode(Datamodel dm, string encoding, int encodingVersion, Stream st
362362
writer.Indent++;
363363
writer.WriteTokenLine("id", "elementid", Guid.NewGuid().ToString());
364364
foreach (var attr in dm.PrefixAttributes)
365-
if(attr.Value != null)
365+
if (attr.Value != null)
366366
{
367367
WriteAttribute(attr.Key, encodingVersion, attr.Value.GetType(), attr.Value, false, writer);
368368
}
@@ -374,7 +374,7 @@ public void Encode(Datamodel dm, string encoding, int encodingVersion, Stream st
374374
if (SupportsReferenceIds)
375375
CountReferences(dm.Root);
376376

377-
if(dm.Root != null)
377+
if (dm.Root != null)
378378
{
379379
WriteElement(dm.Root, encodingVersion, writer);
380380
}
@@ -408,7 +408,7 @@ private class IntermediateData
408408

409409
public void HandleElementProp(Element? element, string attrName, Guid id)
410410
{
411-
if(element is null)
411+
if (element is null)
412412
{
413413
throw new InvalidDataException("Trying to handle the propery of an invalid element");
414414
}
@@ -561,7 +561,7 @@ string Decode_NextToken(StreamReader reader)
561561
}
562562
}
563563
// inline Element
564-
else if (attr_type == typeof(Element))
564+
else if (attr_type == typeof(Element))
565565
{
566566
array.Add(Decode_ParseElement(next, reflectionParams, reader, dataModel, intermediateData));
567567
}

Datamodel.NET/Datamodel.ElementList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void Trim()
219219
{
220220
foreach (var elem in this.Except(used).ToArray())
221221
{
222-
if(elem != null)
222+
if (elem != null)
223223
{
224224
store.Remove(elem.ID);
225225
elem.Owner = null;
@@ -241,7 +241,7 @@ public void Trim()
241241

242242
protected void WalkElemTree(Element? elem, HashSet<Element?> found)
243243
{
244-
if(elem is null)
244+
if (elem is null)
245245
{
246246
return;
247247
}

Datamodel.NET/Datamodel.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private static ICodec GetCodec(string encoding, int encoding_version)
167167

168168
var codecConstructor = codec_type.GetConstructor(Type.EmptyTypes);
169169

170-
if(codecConstructor is null)
170+
if (codecConstructor is null)
171171
{
172172
throw new InvalidOperationException("Failed to get codec constructor.");
173173
}
@@ -310,9 +310,9 @@ public static Datamodel Load<T>(string path, ReflectionParams? reflectionParams
310310
private static Datamodel Load_Internal<T>(Stream stream, Assembly callingAssembly, DeferredMode defer_mode = DeferredMode.Automatic, ReflectionParams? reflectionParams = null)
311311
where T : Element
312312
{
313-
reflectionParams ??= new ();
313+
reflectionParams ??= new();
314314

315-
if(typeof(T) == typeof(Element))
315+
if (typeof(T) == typeof(Element))
316316
{
317317
reflectionParams.AttemptReflection = false;
318318
}
@@ -369,7 +369,7 @@ private static Datamodel Load_Internal<T>(Stream stream, Assembly callingAssembl
369369
{
370370
result = StubRequest(id);
371371

372-
if(result is null)
372+
if (result is null)
373373
{
374374
throw new InvalidDataException("Stub request failed, result was null");
375375
}
@@ -464,7 +464,7 @@ public string Format
464464
get => _Format;
465465
set
466466
{
467-
if(value is null)
467+
if (value is null)
468468
{
469469
throw new InvalidDataException("Format can not be null");
470470
}
@@ -499,7 +499,7 @@ public string Encoding
499499
get => _Encoding;
500500
set
501501
{
502-
if(value is null)
502+
if (value is null)
503503
{
504504
throw new InvalidDataException("Encoding can not be null");
505505
}
@@ -759,7 +759,7 @@ public ImportJob(ImportRecursionMode import_mode, ImportOverwriteMode overwrite_
759759
local_element = null;
760760
}
761761

762-
if(local_element is null)
762+
if (local_element is null)
763763
{
764764
return null;
765765
}
@@ -779,7 +779,7 @@ public ImportJob(ImportRecursionMode import_mode, ImportOverwriteMode overwrite_
779779
var list = (System.Collections.ICollection)attr.Value;
780780
var inner_type = GetArrayInnerType(list.GetType());
781781

782-
if(inner_type is null)
782+
if (inner_type is null)
783783
{
784784
throw new InvalidOperationException("Failed to get inner_type while importing element");
785785
}
@@ -915,7 +915,7 @@ internal DestubException(ElementArray array, int index, Exception innerException
915915
: base("An exception occured while destubbing an array item.", innerException)
916916
{
917917
var arrayOwner = array.Owner;
918-
if(arrayOwner is not null)
918+
if (arrayOwner is not null)
919919
{
920920
Data.Add("Element", ((Element)arrayOwner).ID);
921921
}

0 commit comments

Comments
 (0)