lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use a pointer for the output parameter of Lily_lexer::scan_word (iss


From: nine . fierce . ballads
Subject: Re: Use a pointer for the output parameter of Lily_lexer::scan_word (issue 577440044 by address@hidden)
Date: Sat, 01 Feb 2020 06:19:49 -0800

Consider this function from lily/tie-formatting-problem.cc:

    void
    Tie_formatting_problem::score_ties (Ties_configuration *ties) const
    {
      if (ties->scored_)
        return;
    
      score_ties_configuration (ties);
      score_ties_aptitude (ties);
      ties->scored_ = true;
    }

What is the benefit to using pointers here?  I expect a supporter of
Google's style to answer that it's true that there is no benefit here,
but there is a benefit somewhere up the call chain.  That's here:

    variant.reset_score ();
    score_ties (&variant);

    if (variant.score () < best.score ())
      {
        best = variant;
      }

That is difficult to misunderstand with or without the ampersand.  The
non-null information that references communicate is more useful than
what the ampersand provides here.

https://codereview.appspot.com/577440044/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]