[LyX/master] Fixup f96b99dc: thinko

Jean-Marc Lasgouttes lasgouttes at lyx.org
Fri Oct 2 15:10:56 UTC 2020


Le 02/10/2020 à 15:46, Richard Kimberly Heck a écrit :
>> @@ -972,7 +972,7 @@ MathClass MathData::lastMathClass() const
>>   	for (MathAtom const & at : *this) {
>>   		MathClass mc = at->mathClass();
>>   		if (mc != MC_UNKNOWN)
>> -			return res = mc;
>> +			res = mc;
>>   	}
>>   	return res;
> 
> This is actually fine. Assignment returns a reference to the thing on
> the left, at least by default. That is why
> 
>      a = b =c
> 
> does what you expect.

Well, in this case it did not do what I wanted. I did not want the early 
return (the code returns the last math class that is not MC_UNKNOWN).

Moreover, there is no point in assigning a value to a local variable 
just before returning.

JMarc


More information about the lyx-devel mailing list