Avoid assignment in if() clause

The optimization they provide is not worth it IMO.

Fixes bugs #10898, #10899, #10940.
This commit is contained in:
Jean-Marc Lasgouttes 2017-12-14 11:22:05 +01:00
parent 029a9d2439
commit 4cfa5a9d2a
3 changed files with 6 additions and 8 deletions

View File

@ -459,11 +459,9 @@ namespace {
return false;
// read value
bool legalChar = true;
while (ifs && !isSpace(ch) &&
delimChars.find(ch) == docstring::npos &&
(legalChar = (illegalChars.find(ch) == docstring::npos))
)
delimChars.find(ch) == docstring::npos &&
illegalChars.find(ch) == docstring::npos)
{
if (chCase == makeLowerCase)
val += lowercase(ch);
@ -472,7 +470,7 @@ namespace {
ifs.get(ch);
}
if (!legalChar) {
if (illegalChars.find(ch) != docstring::npos) {
ifs.putback(ch);
return false;
}

View File

@ -388,7 +388,8 @@ void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
else
name = master.B_(tclass.floats().getType(type).name());
docstring counter = from_utf8(type);
if ((is_subfloat_ = cnts.isSubfloat())) {
is_subfloat_ = cnts.isSubfloat();
if (is_subfloat_) {
// only standard captions allowed in subfloats
type_ = "Standard";
counter = "sub-" + from_utf8(type);

View File

@ -689,7 +689,6 @@ void Preamble::handle_package(Parser &p, string const & name,
{
vector<string> options = split_options(opts);
add_package(name, options);
char const * const * where = 0;
if (is_known(name, known_xetex_packages)) {
xetex = true;
@ -1016,7 +1015,7 @@ void Preamble::handle_package(Parser &p, string const & name,
else if (name == "subfig")
; // ignore this FIXME: Use the package separator mechanism instead
else if ((where = is_known(name, known_languages)))
else if (char const * const * where = is_known(name, known_languages))
h_language = known_coded_languages[where - known_languages];
else if (name == "natbib") {