Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 55143e61
authored
Nov 28, 2013
by
Lemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use of .some() rather then .filter() to improve efficiency
1 parent
63e009f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
lib/dialects/abstract/query.js
lib/dialects/abstract/query.js
View file @
55143e6
...
@@ -427,9 +427,9 @@ module.exports = (function() {
...
@@ -427,9 +427,9 @@ module.exports = (function() {
for
(
var
attrName
in
row
)
{
for
(
var
attrName
in
row
)
{
if
(
row
.
hasOwnProperty
(
attrName
)
&&
(
attrName
!==
calleeTableName
))
{
if
(
row
.
hasOwnProperty
(
attrName
)
&&
(
attrName
!==
calleeTableName
))
{
existingEntry
[
attrName
]
=
existingEntry
[
attrName
]
||
[]
existingEntry
[
attrName
]
=
existingEntry
[
attrName
]
||
[]
var
attrRowExists
=
existingEntry
[
attrName
].
filter
(
function
(
attrRow
)
{
var
attrRowExists
=
existingEntry
[
attrName
].
some
(
function
(
attrRow
)
{
return
Utils
.
_
.
isEqual
(
attrRow
,
row
[
attrName
])
return
Utils
.
_
.
isEqual
(
attrRow
,
row
[
attrName
])
})
[
0
]
})
if
(
!
attrRowExists
)
{
if
(
!
attrRowExists
)
{
existingEntry
[
attrName
].
push
(
row
[
attrName
])
existingEntry
[
attrName
].
push
(
row
[
attrName
])
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment