Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
91a48115
Commit
91a48115
authored
Sep 21, 2011
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gob: slightly simpler code for encodeUint
R=r CC=golang-dev
https://golang.org/cl/5077047
parent
d16ceca5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/pkg/gob/encode.go
src/pkg/gob/encode.go
+6
-7
No files found.
src/pkg/gob/encode.go
View file @
91a48115
...
@@ -59,15 +59,14 @@ func (state *encoderState) encodeUint(x uint64) {
...
@@ -59,15 +59,14 @@ func (state *encoderState) encodeUint(x uint64) {
}
}
return
return
}
}
var
n
,
m
int
i
:=
uint64Size
m
=
uint64Size
for
x
>
0
{
for
n
=
1
;
x
>
0
;
n
++
{
state
.
buf
[
i
]
=
uint8
(
x
)
state
.
buf
[
m
]
=
uint8
(
x
)
x
>>=
8
x
>>=
8
m
--
i
--
}
}
state
.
buf
[
m
]
=
uint8
(
-
(
n
-
1
))
state
.
buf
[
i
]
=
uint8
(
i
-
uint64Size
)
// = loop count, negated
n
,
err
:=
state
.
b
.
Write
(
state
.
buf
[
m
:
uint64Size
+
1
])
_
,
err
:=
state
.
b
.
Write
(
state
.
buf
[
i
:
uint64Size
+
1
])
if
err
!=
nil
{
if
err
!=
nil
{
error
(
err
)
error
(
err
)
}
}
...
...
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