优化reverse
This commit is contained in:
@@ -255,7 +255,7 @@ namespace TinySTL{
|
||||
}
|
||||
template<class T>
|
||||
void List<T>::reverse(){//<2F><><EFBFBD><EFBFBD>β<EFBFBD>巨
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user