Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
05aff402
Commit
05aff402
authored
Jun 28, 2012
by
Oleg
Committed by
Dave Methvin
Jul 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization of array operations, closes gh-844.
parent
f8baea8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
core.js
src/core.js
+2
-8
manipulation.js
src/manipulation.js
+9
-7
traversing.js
src/traversing.js
+1
-1
No files found.
src/core.js
View file @
05aff402
...
@@ -197,15 +197,9 @@ jQuery.fn = jQuery.prototype = {
...
@@ -197,15 +197,9 @@ jQuery.fn = jQuery.prototype = {
// Take an array of elements and push it onto the stack
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
// (returning the new matched element set)
pushStack
:
function
(
elems
,
name
,
selector
)
{
pushStack
:
function
(
elems
,
name
,
selector
)
{
// Build a new jQuery matched element set
var
ret
=
this
.
constructor
();
if
(
jQuery
.
isArray
(
elems
)
)
{
core_push
.
apply
(
ret
,
elems
);
}
else
{
// Build a new jQuery matched element set
jQuery
.
merge
(
ret
,
elems
);
var
ret
=
jQuery
.
merge
(
this
.
constructor
(),
elems
);
}
// Add the old object onto the stack (as a reference)
// Add the old object onto the stack (as a reference)
ret
.
prevObject
=
this
;
ret
.
prevObject
=
this
;
...
...
src/manipulation.js
View file @
05aff402
...
@@ -146,10 +146,11 @@ jQuery.fn.extend({
...
@@ -146,10 +146,11 @@ jQuery.fn.extend({
return
this
.
domManip
(
arguments
,
false
,
function
(
elem
)
{
return
this
.
domManip
(
arguments
,
false
,
function
(
elem
)
{
this
.
parentNode
.
insertBefore
(
elem
,
this
);
this
.
parentNode
.
insertBefore
(
elem
,
this
);
});
});
}
else
if
(
arguments
.
length
)
{
}
if
(
arguments
.
length
)
{
var
set
=
jQuery
.
clean
(
arguments
);
var
set
=
jQuery
.
clean
(
arguments
);
set
.
push
.
apply
(
set
,
this
.
toArray
()
);
return
this
.
pushStack
(
jQuery
.
merge
(
set
,
this
),
"before"
,
this
.
selector
);
return
this
.
pushStack
(
set
,
"before"
,
arguments
);
}
}
},
},
...
@@ -158,10 +159,11 @@ jQuery.fn.extend({
...
@@ -158,10 +159,11 @@ jQuery.fn.extend({
return
this
.
domManip
(
arguments
,
false
,
function
(
elem
)
{
return
this
.
domManip
(
arguments
,
false
,
function
(
elem
)
{
this
.
parentNode
.
insertBefore
(
elem
,
this
.
nextSibling
);
this
.
parentNode
.
insertBefore
(
elem
,
this
.
nextSibling
);
});
});
}
else
if
(
arguments
.
length
)
{
}
var
set
=
this
.
pushStack
(
this
,
"after"
,
arguments
);
set
.
push
.
apply
(
set
,
jQuery
.
clean
(
arguments
)
);
if
(
arguments
.
length
)
{
return
set
;
var
set
=
jQuery
.
clean
(
arguments
);
return
this
.
pushStack
(
jQuery
.
merge
(
this
,
set
),
"after"
,
this
.
selector
);
}
}
},
},
...
...
src/traversing.js
View file @
05aff402
...
@@ -199,7 +199,7 @@ jQuery.each({
...
@@ -199,7 +199,7 @@ jQuery.each({
contents
:
function
(
elem
)
{
contents
:
function
(
elem
)
{
return
jQuery
.
nodeName
(
elem
,
"iframe"
)
?
return
jQuery
.
nodeName
(
elem
,
"iframe"
)
?
elem
.
contentDocument
||
elem
.
contentWindow
.
document
:
elem
.
contentDocument
||
elem
.
contentWindow
.
document
:
jQuery
.
m
akeArray
(
elem
.
childNodes
);
jQuery
.
m
erge
(
[],
elem
.
childNodes
);
}
}
},
function
(
name
,
fn
)
{
},
function
(
name
,
fn
)
{
jQuery
.
fn
[
name
]
=
function
(
until
,
selector
)
{
jQuery
.
fn
[
name
]
=
function
(
until
,
selector
)
{
...
...
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