diff --git a/TinySTL/List.h b/TinySTL/List.h index 3e7a501..d6cf168 100644 --- a/TinySTL/List.h +++ b/TinySTL/List.h @@ -255,7 +255,7 @@ namespace TinySTL{ } template void List::reverse(){//²ÉÓÃβ²å·¨ - if (empty() || size() == 1) return; + if (empty() || head.p->next == tail.p) return; auto curNode = head.p; head.p = tail.p->prev; head.p->prev = nullptr;