From 7f56dd65ee706683444b012d0afcfff3e376bfff Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Wed, 29 Sep 2010 05:18:23 +0000 Subject: value_array refactor git-svn-id: https://ws10smt.googlecode.com/svn/trunk@663 ec762483-ff6d-05da-a07a-a48fb63a330f --- utils/value_array.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'utils/value_array.h') diff --git a/utils/value_array.h b/utils/value_array.h index bd6ef27a..12fc9d87 100755 --- a/utils/value_array.h +++ b/utils/value_array.h @@ -95,7 +95,7 @@ protected: sz=0; } void alloc(size_type s) { - array = s==0 ? 0 : A::allocate(s); + array=s?A::allocate(s):0; sz=s; } @@ -142,13 +142,11 @@ protected: } inline void init(size_type s) { - sz=s; - array=s ? A::allocate(s) : 0; + alloc(s); fill(); } inline void init(size_type s, const_reference t) { - sz=s; - array=s ? A::allocate(s) : 0; + alloc(s); fill(t); } public: -- cgit v1.2.3