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
b4bd2e03
Commit
b4bd2e03
authored
Feb 07, 2015
by
csharptest
Committed by
rogerk
Feb 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 84: warning CS0219: The variable `size' is assigned but its value is never used
parent
1e29e701
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
MessageGenerator.cs
src/ProtoGen/MessageGenerator.cs
+12
-4
No files found.
src/ProtoGen/MessageGenerator.cs
View file @
b4bd2e03
...
...
@@ -360,7 +360,7 @@ namespace Google.ProtocolBuffers.ProtoGen
writer
.
WriteLine
(
"public override void WriteTo(pb::ICodedOutputStream output) {"
);
writer
.
Indent
();
// Make sure we've computed the serialized length, so that packed fields are generated correctly.
writer
.
WriteLine
(
"
int size = SerializedSize
;"
);
writer
.
WriteLine
(
"
CalcSerializedSize()
;"
);
writer
.
WriteLine
(
"string[] field_names = _{0}FieldNames;"
,
NameHelpers
.
UnderscoresToCamelCase
(
ClassName
));
if
(
Descriptor
.
Proto
.
ExtensionRangeList
.
Count
>
0
)
{
...
...
@@ -412,6 +412,17 @@ namespace Google.ProtocolBuffers.ProtoGen
writer
.
Indent
();
writer
.
WriteLine
(
"int size = memoizedSerializedSize;"
);
writer
.
WriteLine
(
"if (size != -1) return size;"
);
writer
.
WriteLine
(
"return CalcSerializedSize();"
);
writer
.
Outdent
();
writer
.
WriteLine
(
"}"
);
writer
.
Outdent
();
writer
.
WriteLine
(
"}"
);
writer
.
WriteLine
();
writer
.
WriteLine
(
"private int CalcSerializedSize() {"
);
writer
.
Indent
();
writer
.
WriteLine
(
"int size = memoizedSerializedSize;"
);
writer
.
WriteLine
(
"if (size != -1) return size;"
);
writer
.
WriteLine
();
writer
.
WriteLine
(
"size = 0;"
);
foreach
(
FieldDescriptor
field
in
Descriptor
.
Fields
)
...
...
@@ -438,9 +449,6 @@ namespace Google.ProtocolBuffers.ProtoGen
writer
.
WriteLine
(
"return size;"
);
writer
.
Outdent
();
writer
.
WriteLine
(
"}"
);
writer
.
Outdent
();
writer
.
WriteLine
(
"}"
);
writer
.
WriteLine
();
}
private
void
GenerateSerializeOneField
(
TextGenerator
writer
,
FieldDescriptor
fieldDescriptor
)
...
...
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