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
77d33734
Unverified
Commit
77d33734
authored
Nov 20, 2019
by
Jan Tattermusch
Committed by
GitHub
Nov 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simpler fix
parent
71ac3e5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
29 deletions
+3
-29
CodedInputStream.cs
csharp/src/Google.Protobuf/CodedInputStream.cs
+3
-29
No files found.
csharp/src/Google.Protobuf/CodedInputStream.cs
View file @
77d33734
...
...
@@ -577,32 +577,7 @@ namespace Google.Protobuf
/// </summary>
public
bool
ReadBool
()
{
int
result
=
0
;
// can't do AND on bytes, it gets implicitly upcasted to int
byte
index
=
0
;
if
(
bufferPos
<
bufferSize
)
// check if we have at least one byte for the most likely case of a one byte 1 or 0
{
result
=
buffer
[
bufferPos
++];
if
(
result
<
128
)
{
return
result
!=
0
;
}
result
&=
0x7f
;
index
++;
}
do
{
byte
b
=
ReadRawByte
();
result
|=
b
&
0x7F
;
// OR all bytes together since we don't care about the actual value, just whether is more than zero
if
(
b
<
0x80
)
{
return
result
!=
0
;
}
index
++;
}
while
(
index
<
10
);
throw
InvalidProtocolBufferException
.
MalformedVarint
();
return
ReadRawVarint64
()
!=
0
;
}
/// <summary>
...
...
@@ -870,7 +845,7 @@ namespace Google.Protobuf
internal
static
bool
?
ReadBoolWrapper
(
CodedInputStream
input
)
{
return
ReadUInt
32
Wrapper
(
input
)
!=
0
;
return
ReadUInt
64
Wrapper
(
input
)
!=
0
;
}
internal
static
uint
?
ReadUInt32Wrapper
(
CodedInputStream
input
)
...
...
@@ -1679,4 +1654,4 @@ namespace Google.Protobuf
}
#endregion
}
}
\ No newline at end of file
}
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