From 498bc431f41cedce66e6051e90f0be5743df92dc Mon Sep 17 00:00:00 2001 From: wyy Date: Wed, 19 Mar 2014 23:47:46 -0700 Subject: [PATCH] rm try..catch in HMMSegment --- src/HMMSegment.hpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/HMMSegment.hpp b/src/HMMSegment.hpp index 6deb52c..bd3a1df 100644 --- a/src/HMMSegment.hpp +++ b/src/HMMSegment.hpp @@ -136,21 +136,10 @@ namespace CppJieba size_t now, old, stat; double tmp, endE, endS; - try - { - path = new int [XYSize]; - weight = new double [XYSize]; - } - catch(const std::bad_alloc&) - { - LogError("bad_alloc"); - return false; - } - if(NULL == path || NULL == weight) - { - LogError("bad_alloc"); - return false; - } + path = new int [XYSize]; + assert(path); + weight = new double [XYSize]; + assert(weight); //start for(size_t y = 0; y < Y; y++)