Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
0413e93b
Commit
0413e93b
authored
Jan 27, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6745433a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
t/neo/protogen.go
t/neo/protogen.go
+20
-20
No files found.
t/neo/protogen.go
View file @
0413e93b
...
...
@@ -686,7 +686,7 @@ func (e *encoder) genArray1(path string, typ *types.Array) {
func
(
d
*
decoder
)
genArray1
(
assignto
string
,
typ
*
types
.
Array
)
{
typLen
:=
int
(
typ
.
Len
())
d
.
emit
(
"copy(%v[:], data[%v:%v])"
,
assignto
,
d
.
n
,
d
.
n
+
typLen
)
d
.
emit
(
"copy(%v[:], data[%v:%v])"
,
assignto
,
d
.
n
,
d
.
n
+
typLen
)
d
.
n
+=
typLen
d
.
overflow
.
Add
(
typLen
)
}
...
...
@@ -823,7 +823,7 @@ func (s *sizer) genMap(path string, typ *types.Map, obj types.Object) {
if
keyFixed
&&
elemFixed
{
s
.
size
.
Add
(
4
)
s
.
size
.
AddExpr
(
"len(%v) * %v"
,
path
,
keySize
+
elemSize
)
s
.
size
.
AddExpr
(
"len(%v) * %v"
,
path
,
keySize
+
elemSize
)
return
}
...
...
@@ -880,7 +880,7 @@ func (d *decoder) genMap(assignto string, typ *types.Map, obj types.Object) {
elemSize
,
elemFixed
:=
typeSizeFixed
(
typ
.
Elem
())
if
keyFixed
&&
elemFixed
{
d
.
overflowCheck
()
d
.
overflow
.
AddExpr
(
"l * %v"
,
keySize
+
elemSize
)
d
.
overflow
.
AddExpr
(
"l * %v"
,
keySize
+
elemSize
)
d
.
overflow
.
PushChecked
(
true
)
defer
d
.
overflow
.
PopChecked
()
}
...
...
@@ -933,7 +933,7 @@ func codegenType(path string, typ types.Type, obj types.Object, codegen CodeGene
case
*
types
.
Struct
:
for
i
:=
0
;
i
<
u
.
NumFields
();
i
++
{
v
:=
u
.
Field
(
i
)
codegenType
(
path
+
"."
+
v
.
Name
(),
v
.
Type
(),
v
,
codegen
)
codegenType
(
path
+
"."
+
v
.
Name
(),
v
.
Type
(),
v
,
codegen
)
}
case
*
types
.
Array
:
...
...
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