Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
e613ba69
Commit
e613ba69
authored
Oct 30, 2019
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add braces around single-statement if/foreach
parent
4252b7af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
ExtensionRegistry.cs
csharp/src/Google.Protobuf/ExtensionRegistry.cs
+6
-0
ExtensionCollection.cs
csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs
+2
-0
No files found.
csharp/src/Google.Protobuf/ExtensionRegistry.cs
View file @
e613ba69
...
...
@@ -90,7 +90,9 @@ namespace Google.Protobuf
ProtoPreconditions
.
CheckNotNull
(
extensions
,
nameof
(
extensions
));
foreach
(
var
extension
in
extensions
)
{
Add
(
extension
);
}
}
/// <summary>
...
...
@@ -120,9 +122,13 @@ namespace Google.Protobuf
{
ProtoPreconditions
.
CheckNotNull
(
array
,
nameof
(
array
));
if
(
arrayIndex
<
0
||
arrayIndex
>=
array
.
Length
)
{
throw
new
ArgumentOutOfRangeException
(
nameof
(
arrayIndex
));
}
if
(
array
.
Length
-
arrayIndex
<
Count
)
{
throw
new
ArgumentException
(
"The provided array is shorter than the number of elements in the registry"
);
}
for
(
int
i
=
0
;
i
<
array
.
Length
;
i
++)
{
...
...
csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs
View file @
e613ba69
...
...
@@ -109,7 +109,9 @@ namespace Google.Protobuf.Reflection
IList
<
FieldDescriptor
>
_
;
if
(!
declarationOrder
.
TryGetValue
(
descriptor
.
ExtendeeType
,
out
_
))
{
declarationOrder
.
Add
(
descriptor
.
ExtendeeType
,
new
List
<
FieldDescriptor
>());
}
declarationOrder
[
descriptor
.
ExtendeeType
].
Add
(
descriptor
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment