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
5685e987
Commit
5685e987
authored
Jun 12, 2015
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify ComputeInt32Size to call ComputeInt32SizeNoTag.
parent
1b71db11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
11 deletions
+1
-11
CodedOutputStream.ComputeSize.cs
csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs
+1
-11
No files found.
csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs
View file @
5685e987
...
...
@@ -91,15 +91,7 @@ namespace Google.Protobuf
/// </summary>
public
static
int
ComputeInt32Size
(
int
fieldNumber
,
int
value
)
{
if
(
value
>=
0
)
{
return
ComputeTagSize
(
fieldNumber
)
+
ComputeRawVarint32Size
((
uint
)
value
);
}
else
{
// Must sign-extend.
return
ComputeTagSize
(
fieldNumber
)
+
10
;
}
return
ComputeTagSize
(
fieldNumber
)
+
ComputeInt32SizeNoTag
(
value
);
}
/// <summary>
...
...
@@ -418,7 +410,6 @@ namespace Google.Protobuf
/// </summary>
public
static
int
ComputeRawVarint32Size
(
uint
value
)
{
// TODO(jonskeet): Look at optimizing this to just hard-coded comparisons.
if
((
value
&
(
0xffffffff
<<
7
))
==
0
)
{
return
1
;
...
...
@@ -443,7 +434,6 @@ namespace Google.Protobuf
/// </summary>
public
static
int
ComputeRawVarint64Size
(
ulong
value
)
{
// TODO(jonskeet): Look at optimizing this to just hard-coded comparisons.
if
((
value
&
(
0xffffffffffffffffL
<<
7
))
==
0
)
{
return
1
;
...
...
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