[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r20991 - trunk/contrib/hook-scripts

From: Bhuvaneswaran Arumugam <bhuvan_at_collab.net>
Date: 2006-08-05 19:52:36 CEST

> - if(childNode.nodeName == 'author'):
> - self.feed.insertBefore(item, childNode.nextSibling)
> - elif(childNode.nodeName == 'entry'):
> + if childNode.nodeName == 'entry':
> + if total == 0:
> + self.feed.insertBefore(item, childNode)
> + total += 1
> total += 1

Weird! We increment the "total" twice when the value is 0. Result: We
manage to store max_items-1 items in the feed file. I bet, you intend to
remove the increment statement which resides inside the "if total == 0:"
loop :)

> -- if (total > self.max_items):
> - self.feed.removeChild(self.feed.lastChild)
> + if total > self.max_items:
> + self.feed.removeChild(childNode)

Here again, why do we wish to include the above "if" condition for every
childNode ? We call this function for every revision, so it's good to
place it outside the "for" loop. Moreover, in the current state it'll
not remove multiple nodes (if you intend to), since we increment the
"total" one at a time.

-- 
Regards,
Bhuvaneswaran

Received on Sat Aug 5 19:53:41 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.