From 21a22cb670a3d0791ccbefdff41938222196ead5 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Fri, 3 Jan 2014 16:01:26 +0100 Subject: [PATCH] reporting: simplify code --- matlab/reports/@report_table/write.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/matlab/reports/@report_table/write.m b/matlab/reports/@report_table/write.m index 886b95438..38e57c3ef 100644 --- a/matlab/reports/@report_table/write.m +++ b/matlab/reports/@report_table/write.m @@ -114,12 +114,9 @@ switch dates.freq if size(thdr, 1) > 1 for i=2:size(thdr, 1) split = find(thdr{i-1, 2} == 4, 1, 'first'); - if isempty(split) - error('@report_table.write: Shouldn''t arrive here'); - else - thdr{i, 2} = thdr{i-1, 2}(split+1:end); - thdr{i-1, 2} = thdr{i-1, 2}(1:split); - end + assert(~isempty(split), '@report_table.write: Shouldn''t arrive here'); + thdr{i, 2} = thdr{i-1, 2}(split+1:end); + thdr{i-1, 2} = thdr{i-1, 2}(1:split); end end for i=1:size(thdr, 1)