Browse Source

feature: 代码优化

xiongxt 1 year ago
parent
commit
89b65eaa94
1 changed files with 4 additions and 4 deletions
  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;
   }
 }