[LyX/master] DocBook: slight code simplification.

Thibaut Cuvelier tcuvelier at lyx.org
Sat Sep 19 18:18:56 UTC 2020


commit bfeb3b66b104f6262de8169e32c49413bfe1a79d
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Sep 13 01:50:11 2020 +0200

    DocBook: slight code simplification.
---
 src/output_docbook.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index c8ddc1a..0d0aa10 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -1087,8 +1087,7 @@ void docbookParagraphs(Text const &text,
 
 		// Close all sections before the bibliography.
 		// TODO: Only close all when the bibliography is at the end of the document? Or force to output the bibliography at the end of the document? Or don't care (as allowed by DocBook)?
-		auto insetsLength = distance(par->insetList().begin(), par->insetList().end());
-		if (insetsLength > 0) {
+		if (!par->insetList().empty()) {
 			Inset const *firstInset = par->getInset(0);
 			if (firstInset && (firstInset->lyxCode() == BIBITEM_CODE || firstInset->lyxCode() == BIBTEX_CODE)) {
 				while (!headerLevels.empty()) {


More information about the lyx-cvs mailing list