Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
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
Alexandra Rogova
jio_mebibou
Commits
3373d8d1
Commit
3373d8d1
authored
Mar 27, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve function performance
parent
dd3ceed4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/jio/core/util.js
src/jio/core/util.js
+7
-9
No files found.
src/jio/core/util.js
View file @
3373d8d1
...
@@ -168,16 +168,14 @@ exports.util.dictFilter = dictFilter;
...
@@ -168,16 +168,14 @@ exports.util.dictFilter = dictFilter;
* @return {Object} The type dict
* @return {Object} The type dict
*/
*/
function
arrayValuesToTypeDict
(
array
)
{
function
arrayValuesToTypeDict
(
array
)
{
var
i
,
type
,
types
=
{};
var
i
,
l
,
type_object
=
{},
type
,
v
;
for
(
i
=
0
;
i
<
array
.
length
;
i
+=
1
)
{
for
(
i
=
0
,
l
=
array
.
length
;
i
<
l
;
i
+=
1
)
{
type
=
Array
.
isArray
(
array
[
i
])
?
'
array
'
:
typeof
array
[
i
];
v
=
array
[
i
];
if
(
!
types
[
type
])
{
type
=
Array
.
isArray
(
v
)
?
"
array
"
:
typeof
v
;
types
[
type
]
=
[
array
[
i
]];
/*jslint ass: true */
}
else
{
(
type_object
[
type
]
=
type_object
[
type
]
||
[]).
push
(
v
);
types
[
type
][
types
[
type
].
length
]
=
array
[
i
];
}
}
return
type_object
;
}
return
types
;
}
}
/**
/**
...
...
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