flebel / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Error in models.py #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In revision 57, line 166 of models.py reads:

        if len(tags) == 0:
            tag = tags[0] # Optimisation for single tag

Assuming the comment is correct, it should read:

if len(tags) == 1:

Because len(), like count/length in so many other languages starts with
one.  len(tags) == 0 should probably be an error condition.  Because this
"optimization" doesn't get called it doesn't look like it works either.

Original issue reported on code.google.com by max.batt...@gmail.com on 20 May 2007 at 5:09

GoogleCodeExporter commented 9 years ago
P'oh - silly typo. Fixed in revision 58.

Original comment by jonathan.buchanan on 21 May 2007 at 12:32