From 3f3e167d81702bb90fc90a37431cbb082cb3620c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Thu, 27 Nov 2014 11:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96reverse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/List.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;