Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-ws-transport
Commits
642b9c2a
Commit
642b9c2a
authored
Sep 17, 2019
by
Alex Browne
Committed by
Steven Allen
Sep 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify iteration over Uint8Array
parent
b84e264b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
conn_browser.go
conn_browser.go
+2
-2
No files found.
conn_browser.go
View file @
642b9c2a
...
...
@@ -115,8 +115,8 @@ func (c *Conn) Write(b []byte) (n int, err error) {
return
0
,
err
}
uint8Array
:=
js
.
Global
()
.
Get
(
"Uint8Array"
)
.
New
(
len
(
b
))
for
i
:=
0
;
i
<
len
(
b
);
i
++
{
uint8Array
.
SetIndex
(
i
,
b
[
i
]
)
for
i
,
bi
:=
range
b
{
uint8Array
.
SetIndex
(
i
,
b
i
)
}
c
.
Call
(
"send"
,
uint8Array
.
Get
(
"buffer"
))
return
len
(
b
),
nil
...
...
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