Yes, it's definitely "funny".  But it saves a line of code, or a call to
seg->element(track), I guess.  Technically, we should check that - which is
of type Element - directly, and only if it turns out to be the correct type
should we cast it.  But it's harmless and slightly more compact or more
efficient the way it is.

On Fri, May 15, 2015 at 3:09 PM, Jim Newton <[email protected]> wrote:

> I found the following curious usage. Does anyone think it is wrong. The
> code
> is taking and Element and casting it to Chord* before checking its element
> type. I would think the static_cast<chord*> and the if ( ... chord-.tupe()
> != Element::Type::CHORD) continue should be reversed? Am I confused?
>
>
> https://github.com/musescore/MuseScore/blob/8911cdd6c94faf8a0d569829fb885fa2ddcd0f7d/libmscore/rendermidi.cpp#L1013-L1016
>
>
>
>
> --
> View this message in context:
> http://dev-list.musescore.org/funny-use-of-static-cast-tp7579351p7579354.html
> Sent from the MuseScore Developer mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Mscore-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>



-- 
Marc Sabatella
[email protected]
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to