Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab56e11

Browse filesBrowse files
committed
fix: C for loop instead of for...of
1 parent eb8020a commit ab56e11
Copy full SHA for ab56e11

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎packages/core/data/dom-events/dom-event.ts

Copy file name to clipboardExpand all lines: packages/core/data/dom-events/dom-event.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,10 @@ export class DOMEvent implements Event {
331331
const eventPath = this.getEventPath(target, 'capture');
332332

333333
// Capturing phase, e.g. [Page, StackLayout, Button]
334-
for (const currentTarget of eventPath) {
334+
// This traditional C loop runs 150 nanoseconds faster than a for...of
335+
// loop.
336+
for (let i = 0; i < eventPath.length; i++) {
337+
const currentTarget = eventPath[i];
335338
this.currentTarget = currentTarget;
336339
this.eventPhase = this.target === this.currentTarget ? this.AT_TARGET : this.CAPTURING_PHASE;
337340

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.