This commit is contained in:
邹晓航
2014-12-23 11:22:30 +08:00
parent 0a2c97bc48
commit 32a3115e96

View File

@@ -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){