Marc Hohl <m...@hohlart.de> writes:

> Am 16.09.2011 10:12, schrieb Marc Hohl:
>> Hello list,
>>
>> I tried to convert a pitch into a string like this:
>>
>> Pitch *current_pitch = unsmob_pitch (event->get_property ("pitch"));
>> string pitchstring = current_pitch.to_string ();
> Sorry for the noise - on console, everything looked right, but in the
> mail, I saw the
> culprit:
>
> Pitch current_pitch = *unsmob_pitch (event->get_property ("pitch"));
> string pitchstring = current_pitch.to_string ();
>
> works fine.

Unnecessary copying.  Better do

Pitch *current_pitch = unsmob_pitch (event->get_property ("pitch"));
string pitchstring = current_pitch->to_string ();

-- 
David Kastrup


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to