[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pitch to string conversion in c++
From: |
David Kastrup |
Subject: |
Re: pitch to string conversion in c++ |
Date: |
Fri, 16 Sep 2011 10:43:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Marc Hohl <address@hidden> 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