Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
b03b0779
Commit
b03b0779
authored
Feb 25, 2017
by
astaxie
Committed by
GitHub
Feb 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2455 from jyk1987/develop
Improve json coding performance
parents
1d49a4bc
393e4c49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
output.go
context/output.go
+5
-4
No files found.
context/output.go
View file @
b03b0779
...
...
@@ -331,16 +331,17 @@ func (output *BeegoOutput) IsServerError() bool {
func
stringsToJSON
(
str
string
)
string
{
rs
:=
[]
rune
(
str
)
jsons
:=
""
var
jsons
bytes
.
Buffer
for
_
,
r
:=
range
rs
{
rint
:=
int
(
r
)
if
rint
<
128
{
jsons
+=
string
(
r
)
jsons
.
WriteRune
(
r
)
}
else
{
jsons
+=
"
\\
u"
+
strconv
.
FormatInt
(
int64
(
rint
),
16
)
// json
jsons
.
WriteString
(
"
\\
u"
)
jsons
.
WriteString
(
strconv
.
FormatInt
(
int64
(
rint
),
16
))
}
}
return
jsons
return
jsons
.
String
()
}
// Session sets session item value with given key.
...
...
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