From 32a3115e96d6ec46daa96c81ebbb041f21f46990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Tue, 23 Dec 2014 11:22:30 +0800 Subject: [PATCH] bug fix --- TinySTL/String.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TinySTL/String.h b/TinySTL/String.h index 122d398..b13f4f1 100644 --- a/TinySTL/String.h +++ b/TinySTL/String.h @@ -184,7 +184,8 @@ namespace TinySTL{ size_type getNewCapacity(size_type len)const{ size_type oldCapacity = endOfStorage_ - start_; auto res = TinySTL::max(oldCapacity, len); - size_type newCapacity = (oldCapacity != 0 ? (oldCapacity + res) : 1); + //size_type newCapacity = (oldCapacity != 0 ? (oldCapacity + res) : 1); + auto newCapacity = oldCapacity + res; return newCapacity; } void allocateAndFillN(size_t n, char c){