orf / simple

Simple is a clone of Obtvse written in Python running on Flask.
MIT License
505 stars 280 forks source link

Update simple.py #25

Closed jasanjun closed 11 years ago

jasanjun commented 11 years ago

does this work?

hellerbarde commented 11 years ago

That looks a lot better. Have you tried it out? Does it do what it should? And thanks for your contribution!

hellerbarde commented 11 years ago

On a second look, this seems to query the database unnecessarily n times, with n being the number of existing collisions. We should only query the database once. Try using "startswith(....)" as a condition. See the SQLalchemy doc for more info. I'd do this myself, but I have really little time right now and I figured that you might want credit for identifying and now fixing this issue :)

Thanks!

orf commented 11 years ago

I'm gonna close this as there has been no activity on this and I don't know if it works, plus the current method seems fine.