[MERGE] versionedfile.py code cleanups

Martin Pool mbp at sourcefrog.net
Thu Sep 20 04:05:44 BST 2007


On 9/20/07, Robert Collins <robertc at robertcollins.net> wrote:
> On Thu, 2007-09-20 at 10:01 +1000, Ian Clatworthy wrote:
> > Robert Collins wrote:
> > > On Thu, 2007-09-20 at 09:42 +1000, Ian Clatworthy wrote:
> > >> @@ -424,7 +426,8 @@
> > >>      def annotate(self, version_id):
> > >>          return list(self.annotate_iter(version_id))
> > >>
> > >> -    def _apply_delta(self, lines, delta):
> > >> +    @staticmethod
> > >> +    def _apply_delta(lines, delta):
> > >>          """Apply delta to lines."""
> > >>          lines = list(lines)
> > >>          offset = 0
> > >
> > > Whats this for?
> >
> > It's only used in knit.py as best I can find. It has nothing to do with
> > the object so it can be a plain function instead of a static method if
> > you'd prefer.
>
> Well changing it without changing anything else seems to suggest it is
> currently unused :)

It is used.

  self.foo()

doesn't care if foo is an instance or static method.  So the change is ok.

-- 
Martin



More information about the bazaar mailing list