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
24856db0
Commit
24856db0
authored
Jul 27, 2008
by
temporal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applied Ulrich Kunitz's patches to slightly optimize Python serialization code.
parent
6fdb0964
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
CONTRIBUTORS.txt
CONTRIBUTORS.txt
+2
-0
output_stream.py
python/google/protobuf/internal/output_stream.py
+2
-3
wire_format.py
python/google/protobuf/internal/wire_format.py
+1
-1
No files found.
CONTRIBUTORS.txt
View file @
24856db0
...
@@ -36,3 +36,5 @@ Maven packaging:
...
@@ -36,3 +36,5 @@ Maven packaging:
Non-Google patch contributors:
Non-Google patch contributors:
Kevin Ko <kevin.s.ko@gmail.com>
Kevin Ko <kevin.s.ko@gmail.com>
Johan Euphrosine <proppy@aminche.com>
Ulrich Kunitz <kune@deine-taler.de>
python/google/protobuf/internal/output_stream.py
View file @
24856db0
...
@@ -101,11 +101,10 @@ class OutputStream(object):
...
@@ -101,11 +101,10 @@ class OutputStream(object):
while
True
:
while
True
:
bits
=
unsigned_value
&
0x7f
bits
=
unsigned_value
&
0x7f
unsigned_value
>>=
7
unsigned_value
>>=
7
if
unsigned_value
:
bits
|=
0x80
self
.
_buffer
.
append
(
bits
)
if
not
unsigned_value
:
if
not
unsigned_value
:
self
.
_buffer
.
append
(
bits
)
break
break
self
.
_buffer
.
append
(
0x80
|
bits
)
def
ToString
(
self
):
def
ToString
(
self
):
"""Returns a string containing the bytes in our internal buffer."""
"""Returns a string containing the bytes in our internal buffer."""
...
...
python/google/protobuf/internal/wire_format.py
View file @
24856db0
...
@@ -87,7 +87,7 @@ def ZigZagEncode(value):
...
@@ -87,7 +87,7 @@ def ZigZagEncode(value):
"""
"""
if
value
>=
0
:
if
value
>=
0
:
return
value
<<
1
return
value
<<
1
return
(
(
value
<<
1
)
^
(
~
0
))
|
0x1
return
(
value
<<
1
)
^
(
~
0
)
def
ZigZagDecode
(
value
):
def
ZigZagDecode
(
value
):
...
...
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