lyx-devel  

RE: r33329 - in lyx-devel/trunk/src: . mathed

Vincent van Ravesteijn - TNW
Fri, 05 Feb 2010 10:36:18 -0800

>>> +   const char *font_name;
>>> +   switch (type_) {
>>> +   return from_ascii(font_name);
>>> }
>>>     
>>
>> Please use "docstring font_name;" and "font_name = from_ascii(..);"
>>   
>What do we gain ? Isn't it only more overhead ? We create another
>docstring instance which then needs to be copied.
>

We (almost) nowhere use "const char *", so please stick to the style of
the rest of the code and use strings (or docstrings when necessary). 

Vincent

P.S. You can also use "string font_name = ... .;" and "return
from_utf8(font_name);", if you don't want to create an unnecessary
docstring. But in general I like the variable that is returned to be of
the same type as the return type of the function.