From f323a64fc34b83268b769fe549d1bc5801dd19b3 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 15 Aug 2016 03:22:01 +0200 Subject: [PATCH] Adapt code to comment --- src/graphics/PreviewLoader.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index f3bf437811..e9b1d47202 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -103,13 +103,11 @@ lyx::Converter const * setConverter(string const & from) }); #else // This is also thread-safe according to ยง6.7.4 of the C++11 standard. - static bool first = true; - if (first) { - first = false; - LYXERR0("PreviewLoader::startLoading()\n" - << "No converter from \"" << from - << "\" format has been defined."); - } + static bool once = ([&]{ + LYXERR0("PreviewLoader::startLoading()\n" + << "No converter from \"" << from + << "\" format has been defined."); + } (), true); #endif return 0; }