From 952851a9bcbe6801e73aacc86de0b40bab7d192b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 12 Jan 2024 12:16:31 +0100 Subject: [PATCH] Do not pass list of columns parameter by value There is no need for copying this information. Noticed by coverity scan. --- src/insets/InsetTabular.cpp | 14 +++++++------- src/insets/InsetTabular.h | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 27201d217b..112e80643c 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2599,8 +2599,8 @@ bool Tabular::isPartOfMultiRow(row_type row, col_type column) const } -void Tabular::TeXTopHLine(otexstream & os, row_type row, list columns, - list logical_columns) const +void Tabular::TeXTopHLine(otexstream & os, row_type row, list const & columns, + list const & logical_columns) const { // we only output complete row lines and the 1st row here, the rest // is done in Tabular::TeXBottomHLine(...) @@ -2716,8 +2716,8 @@ void Tabular::TeXTopHLine(otexstream & os, row_type row, list columns, } -void Tabular::TeXBottomHLine(otexstream & os, row_type row, list columns, - list logical_columns) const +void Tabular::TeXBottomHLine(otexstream & os, row_type row, list const & columns, + list const & logical_columns) const { // we output bottomlines of row r and the toplines of row r+1 // if the latter do not span the whole tabular @@ -3081,8 +3081,8 @@ void Tabular::TeXCellPostamble(otexstream & os, idx_type cell, void Tabular::TeXLongtableHeaderFooter(otexstream & os, OutputParams const & runparams, - list columns, - list logical_columns) const + list const & columns, + list const & logical_columns) const { if (!is_long_tabular) return; @@ -3164,7 +3164,7 @@ bool Tabular::isValidRow(row_type row) const void Tabular::TeXRow(otexstream & os, row_type row, OutputParams const & runparams, - list columns, list logical_columns) const + list const & columns, list const & logical_columns) const { //output the top line TeXTopHLine(os, row, columns, logical_columns); diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 84b9ae4222..4dba557a80 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -923,8 +923,8 @@ public: /// bool isValidRow(row_type const row) const; /// - void TeXRow(otexstream &, row_type const row, - OutputParams const &, std::list, std::list) const; + void TeXRow(otexstream &, row_type const row, OutputParams const &, + std::list const &, std::list const &) const; /// change associated Buffer void setBuffer(Buffer & buffer); @@ -982,19 +982,19 @@ private: /// // helper function for LaTeX /// - void TeXTopHLine(otexstream &, row_type row, std::list, - std::list) const; + void TeXTopHLine(otexstream &, row_type row, std::list const &, + std::list const &) const; /// - void TeXBottomHLine(otexstream &, row_type row, std::list, - std::list) const; + void TeXBottomHLine(otexstream &, row_type row, std::list const &, + std::list const &) const; /// void TeXCellPreamble(otexstream &, idx_type cell, bool & ismulticol, bool & ismultirow, bool const bidi) const; /// void TeXCellPostamble(otexstream &, idx_type cell, bool ismulticol, bool ismultirow) const; /// - void TeXLongtableHeaderFooter(otexstream &, OutputParams const &, std::list, - std::list) const; + void TeXLongtableHeaderFooter(otexstream &, OutputParams const &, std::list const &, + std::list const &) const; }; // Tabular -- 2.39.5