Duplicate appearance of styfiles in styFiles.lst

Scott Kostyshak scott.kostyshak at gmail.com
Thu Jun 2 21:57:09 UTC 2022


On Thu, Jun 02, 2022 at 12:48:17PM +0200, Kornel Benko wrote:
> Am Thu, 2 Jun 2022 11:56:41 +0200
> schrieb Kornel Benko <kornel at lyx.org>:
> 
> > Am Wed, 1 Jun 2022 08:01:19 -0400
> > schrieb Scott Kostyshak <skostysh at lyx.org>:
> > 
> > > On Wed, Jun 01, 2022 at 10:59:47AM +0200, Kornel Benko wrote:  
> > > > Am Tue, 31 May 2022 12:20:55 +0200
> > > > schrieb Kornel Benko <kornel at lyx.org>:
> > > >     
> > > > > At least here is what I can see:
> > > > > 
> > > > > 	$ wc styFiles.lst
> > > > > 	 11429  11429 812660 styFiles.lst
> > > > > 	$ sort styFiles.lst | uniq| wc
> > > > > 	   5943    5943  422983
> > > > > 
> > > > > 	Kornel    
> > > > 
> > > > Attached patch fixes it. OK to commit?    
> > > 
> > > I checked and I have duplicates also. Thanks for fixing this!
> > > 
> > > The patch looks good to me, +1 to commit. Here are some comments that
> > > after thinking more I'm guessing you should _not_ incorporate:
> > > 
> > > I was wondering whether a set would be more appropriate than a
> > > dictionary since the "1" seems irrelevant from what I can see. But after
> > > some searching I did not find any performance advantage of using a set.
> > > And dictionaries are more common, so I think your patch is good.
> > > 
> > > One other minor comment is I wonder if preallocating the dictionary
> > > could speed things up a bit? But then I realized that the script speed
> > > is probably dominatinated by something else (I/O?), so probably better
> > > to avoid complication for something that doesn't have a non-trivial
> > > impact on speed.
> > > 
> > > Scott  
> > 
> > Thanks Scott. I was hoping someone has a better idea. In fact, there is.
> > Simply move
> > 	visited = set()
> > to outside of the 'for'-loop.
> > The resulting output is the same as with my previous patch.
> > 
> > 	Kornel
> > 
> 
> Committed at a379c5d5

Nice and simple! I did not realize there was a set already there.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220602/92a7414c/attachment.asc>


More information about the lyx-devel mailing list