From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTest Nested v12 01/21] Optimize and re-format previous code of 'submenu' parsing Date: Fri, 11 Sep 2015 08:29:16 +0100 Message-ID: <1441956556.24382.16.camel@citrix.com> References: <1440774490-16725-1-git-send-email-robert.hu@intel.com> <1440774490-16725-2-git-send-email-robert.hu@intel.com> <22001.44271.345866.370761@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <22001.44271.345866.370761@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson , Robert Ho Cc: gordon.jin@intel.com, wei.liu2@citrix.com, di.zheng@intel.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-09-10 at 17:16 +0100, Ian Jackson wrote: > Robert Ho writes ("[OSSTest Nested v12 01/21] Optimize and re-format > previous code of 'submenu' parsing"): > > * space between ')' and '{'; and after '=' > > * omit unnecessary 'define' and '!defined' usage > > * break long '{}' into several lines > > These changes are all good. > > But } > > > if (m/^\s*submenu\s+[\'\"](.*)[\'\"].*\{\s*$/) { > > - $submenu={ StartLine =>$., MenuEntryPath => join > ">", @offsets }; > > + $submenu= { StartLine =>$. }; > > This drops the setting of MenuEntryPath from $submenu. This isn't > mentioned in the commit message, and (without looking at the code to > double-check) I'm not sure that it's right. >>From memory MenuEntryPath is unused, but I left it there because when debugging it was very convenient to use Data::Dumper to dump $submenu and/or $entry at each iteration and in that case having that information to hand can be useful. I suppose one could argue that when debugging you can add this field back, but personally I'd prefer to just leave it as it's harmless. Ian. > > Thanks, > Ian.