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
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to