octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #10147] interpreter: Avoid string construc


From: Petter Tomner
Subject: [Octave-patch-tracker] [patch #10147] interpreter: Avoid string construction
Date: Tue, 14 Dec 2021 16:15:58 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Follow-up Comment #2, patch #10147 (project octave):

OK I'll split the patch up and post them here. I'll rebase to HEAD too.

I missed the tab rule. I'll untabify. 

>  Does it compile for you? It looks like the fcn_info_rep constructor is
missing an argument. Or I can't see where `m_file_name` gets actually set...
Yes it compiled, even though I am new to hg so I might have messed something
up.

'm_full_name' is set in the constructor initializer list. It is impossible to
see from the patch diff that 'name' is split up into 'package_name' and back
into 'name' in the ctor. So 'name' is initially the full name. (I should have
used 'nm' instead for setting m_full_name for clarity.)


      fcn_info_rep (const std::string& nm)
        : name (nm), package_name (), m_full_name (name), local_functions (),
          /* ... */
      {
        std::size_t pos = name.rfind ('.');
        if (pos != std::string::npos)
          {
            package_name = name.substr (0, pos);
            name = name.substr (pos+1);
          }
      }


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10147>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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