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
828510cd
Commit
828510cd
authored
Nov 24, 2008
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor IsInitialized to match Java version
parent
4cf9e3c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
GeneratedMessage.cs
src/ProtocolBuffers/GeneratedMessage.cs
+4
-10
todo.txt
todo.txt
+0
-1
No files found.
src/ProtocolBuffers/GeneratedMessage.cs
View file @
828510cd
...
...
@@ -84,20 +84,14 @@ namespace Google.ProtocolBuffers {
public
override
bool
IsInitialized
{
get
{
/* if (!DescriptorForType.HasRequiredFields) {
return true;
}*/
// Check that all required fields are present.
foreach
(
FieldDescriptor
field
in
DescriptorForType
.
Fields
)
{
// Check that all required fields are present.
if
(
field
.
IsRequired
&&
!
HasField
(
field
))
{
return
false
;
}
}
// Check that embedded messages are initialized.
// This code is similar to that in AbstractMessage, but we don't
// fetch all the field values - just the ones we need to.
foreach
(
FieldDescriptor
field
in
DescriptorForType
.
Fields
)
{
// Check that embedded messages are initialized.
// This code is similar to that in AbstractMessage, but we don't
// fetch all the field values - just the ones we need to.
if
(
field
.
MappedType
==
MappedType
.
Message
)
{
if
(
field
.
IsRepeated
)
{
// We know it's an IList<T>, but not the exact type - so
...
...
todo.txt
View file @
828510cd
...
...
@@ -2,7 +2,6 @@ Current task list (not in order)
Diff stuff
- Refactor IsInitialized
- Performance framework
- Optionally remove dependencies to core and csharp options
- Remove multifile support
...
...
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