From bcba4ae75b11548bbd961577ce2e49095e37231c Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Mon, 2 Sep 2019 17:52:09 +0200
Subject: [PATCH] remove superfluous asserts

---
 src/@graph/write.m                       | 1 -
 src/@page/write.m                        | 2 --
 src/@paragraph/write.m                   | 1 -
 src/@report_data/writeDataForTable.m     | 4 ----
 src/@report_series/writeSeriesForTable.m | 1 -
 src/@report_table/write.m                | 1 -
 src/@section/write.m                     | 1 -
 src/@vspace/write.m                      | 2 --
 8 files changed, 13 deletions(-)

diff --git a/src/@graph/write.m b/src/@graph/write.m
index 4454a6c..0cf707b 100644
--- a/src/@graph/write.m
+++ b/src/@graph/write.m
@@ -34,7 +34,6 @@ function write(o, fid, pg, sec, row, col, rep_dir)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
 graphName = writeGraphFile(o, pg, sec, row, col, rep_dir);
 fprintf(fid, '\\input{%s}', graphName);
 end
\ No newline at end of file
diff --git a/src/@page/write.m b/src/@page/write.m
index 1138521..63b2675 100644
--- a/src/@page/write.m
+++ b/src/@page/write.m
@@ -31,8 +31,6 @@ function write(o, fid, pg, rep_dir)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
-
 fprintf(fid, '\n%% Page Number %d written %s\n', pg, datestr(now));
 if strcmpi(o.orientation, 'landscape')
     fprintf(fid, '\\begin{landscape}\n');
diff --git a/src/@paragraph/write.m b/src/@paragraph/write.m
index a800438..8133a04 100644
--- a/src/@paragraph/write.m
+++ b/src/@paragraph/write.m
@@ -29,7 +29,6 @@ function write(o, fid)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
 fprintf(fid, '%% Paragraph Object written %s\n', datestr(now));
 fprintf(fid, '\\multicolumn{1}{p{\\linewidth}}{%%\n');
 if o.cols ~= 1
diff --git a/src/@report_data/writeDataForTable.m b/src/@report_data/writeDataForTable.m
index 109c485..1df33dc 100644
--- a/src/@report_data/writeDataForTable.m
+++ b/src/@report_data/writeDataForTable.m
@@ -31,10 +31,6 @@ function writeDataForTable(o, fid, precision)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-%% Validate options passed to function
-assert(fid ~= -1);
-assert(isint(precision));
-
 %% Validate options provided by user
 assert(ischar(o.tableSubSectionHeader), '@report_data.writeDataForTable: tableSubSectionHeader must be a string');
 if isempty(o.tableSubSectionHeader)
diff --git a/src/@report_series/writeSeriesForTable.m b/src/@report_series/writeSeriesForTable.m
index 1670650..dbdad25 100644
--- a/src/@report_series/writeSeriesForTable.m
+++ b/src/@report_series/writeSeriesForTable.m
@@ -35,7 +35,6 @@ function writeSeriesForTable(o, fid, dates, precision, ncols, rowcolor)
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
 %% Validate options passed to function
-assert(fid ~= -1);
 for i=1:length(dates)
     assert(isdates(dates{i}));
 end
diff --git a/src/@report_table/write.m b/src/@report_table/write.m
index 9b5315a..7769589 100644
--- a/src/@report_table/write.m
+++ b/src/@report_table/write.m
@@ -34,7 +34,6 @@ function write(o, fid, pg, sec, row, col, rep_dir)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
 tableName = writeTableFile(o, pg, sec, row, col, rep_dir);
 fprintf(fid, '\\input{%s}', tableName);
 end
diff --git a/src/@section/write.m b/src/@section/write.m
index aec369b..4e68ac7 100644
--- a/src/@section/write.m
+++ b/src/@section/write.m
@@ -32,7 +32,6 @@ function write(o, fid, pg, sec, rep_dir)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
 fprintf(fid, '%% Section Object written %s\n', datestr(now));
 if isempty(o.elements)
     warning(['reporting:section.write(): trying to print a section ' ...
diff --git a/src/@vspace/write.m b/src/@vspace/write.m
index d3d7a18..1a7eb55 100644
--- a/src/@vspace/write.m
+++ b/src/@vspace/write.m
@@ -29,8 +29,6 @@ function o = write(o, fid)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-assert(fid ~= -1);
-
 fprintf(fid, repmat(' \\par \\medskip ', 1, o.number));
 if o.hline > 0
     fprintf(fid, ['\\\\\n' repmat('\\midrule', 1, o.hline)]);
-- 
GitLab