Commit e613ba69 authored by Jon Skeet's avatar Jon Skeet

Add braces around single-statement if/foreach

parent 4252b7af
...@@ -90,7 +90,9 @@ namespace Google.Protobuf ...@@ -90,7 +90,9 @@ namespace Google.Protobuf
ProtoPreconditions.CheckNotNull(extensions, nameof(extensions)); ProtoPreconditions.CheckNotNull(extensions, nameof(extensions));
foreach (var extension in extensions) foreach (var extension in extensions)
{
Add(extension); Add(extension);
}
} }
/// <summary> /// <summary>
...@@ -120,9 +122,13 @@ namespace Google.Protobuf ...@@ -120,9 +122,13 @@ namespace Google.Protobuf
{ {
ProtoPreconditions.CheckNotNull(array, nameof(array)); ProtoPreconditions.CheckNotNull(array, nameof(array));
if (arrayIndex < 0 || arrayIndex >= array.Length) if (arrayIndex < 0 || arrayIndex >= array.Length)
{
throw new ArgumentOutOfRangeException(nameof(arrayIndex)); throw new ArgumentOutOfRangeException(nameof(arrayIndex));
}
if (array.Length - arrayIndex < Count) if (array.Length - arrayIndex < Count)
{
throw new ArgumentException("The provided array is shorter than the number of elements in the registry"); throw new ArgumentException("The provided array is shorter than the number of elements in the registry");
}
for (int i = 0; i < array.Length; i++) for (int i = 0; i < array.Length; i++)
{ {
......
...@@ -109,7 +109,9 @@ namespace Google.Protobuf.Reflection ...@@ -109,7 +109,9 @@ namespace Google.Protobuf.Reflection
IList<FieldDescriptor> _; IList<FieldDescriptor> _;
if (!declarationOrder.TryGetValue(descriptor.ExtendeeType, out _)) if (!declarationOrder.TryGetValue(descriptor.ExtendeeType, out _))
{
declarationOrder.Add(descriptor.ExtendeeType, new List<FieldDescriptor>()); declarationOrder.Add(descriptor.ExtendeeType, new List<FieldDescriptor>());
}
declarationOrder[descriptor.ExtendeeType].Add(descriptor); declarationOrder[descriptor.ExtendeeType].Add(descriptor);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment