Ver Fonte

feature: 代码优化

xiongxt há 2 anos atrás
pai
commit
89b65eaa94
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      src/queue.ts

+ 4 - 4
src/queue.ts

@@ -80,13 +80,13 @@ class Node<T = any> {
 
   destroy() {
     if (this.prev) {
-      this.prev.setNext(null);
+      this.prev.setNext(undefined);
     }
     if (this.next) {
-      this.next.setPrev(null);
+      this.next.setPrev(undefined);
     }
-    this.prev = null;
-    this.next = null;
+    this.prev = undefined;
+    this.next = undefined;
     this.self = undefined;
   }
 }