[LyX/master] Micro optimization and constness

Richard Kimberly Heck rikiheck at lyx.org
Tue Jan 5 23:21:13 UTC 2021


commit 79a21be5c3edce6baafab9979065fefef76130c1
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Tue Jan 5 13:31:45 2021 -0500

    Micro optimization and constness
---
 src/mathed/InsetMathGrid.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index c01c74a..4dbd8a1 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -1258,7 +1258,7 @@ void InsetMathGrid::write(TeXMathStream & os,
 		for (col_type col = beg_col; col < end_col; ++col) {
 			idx_type const idx = index(row, col);
 			bool const empty_cell = cell(idx).empty();
-			if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL)
+			if (last_eoln && (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL))
 				last_eoln = false;
 			if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL ||
 			    colinfo_[col + 1].lines) {
@@ -1269,7 +1269,7 @@ void InsetMathGrid::write(TeXMathStream & os,
 		for (col_type col = beg_col; col < end_col;) {
 			int nccols = 1;
 			idx_type const idx = index(row, col);
-			TexRow::RowEntry entry = TexRow::mathEntry(id(),idx);
+			TexRow::RowEntry const entry = TexRow::mathEntry(id(),idx);
 			os.texrow().start(entry);
 			if (col >= lastcol) {
 				++col;


More information about the lyx-cvs mailing list