fix: combine splice-and-push into just splice

This commit is contained in:
shirakaba
2022-12-20 18:44:50 +09:00
parent afa78dd85f
commit d8b83e46e3

View File

@@ -192,8 +192,7 @@ export class DOMEvent implements Event {
* [Button, StackLayout, Page] // 'bubble' * [Button, StackLayout, Page] // 'bubble'
*/ */
private getEventPath(responder: Observable, path: 'capture' | 'bubble'): Observable[] { private getEventPath(responder: Observable, path: 'capture' | 'bubble'): Observable[] {
recycledEventPath.splice(0, recycledEventPath.length); recycledEventPath.splice(0, recycledEventPath.length, responder);
recycledEventPath.push(responder);
if (!responder.isViewBase()) { if (!responder.isViewBase()) {
return recycledEventPath; return recycledEventPath;