Commit ed51dd5d authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Avoid an O(n**2) operation where O(n) will suffice. Possibly worth a second...

Avoid an O(n**2) operation where O(n) will suffice.  Possibly worth a second or two when running the test suite.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 89219a68
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -631,8 +631,10 @@ class BaseDatabaseIntrospection(object):
            for model in models.get_models(app):
                if router.allow_syncdb(self.connection.alias, model):
                    all_models.append(model)
        return set([m for m in all_models
            if self.table_name_converter(m._meta.db_table) in map(self.table_name_converter, tables)
        tables = map(self.table_name_converter, tables)
        return set([
            m for m in all_models
            if self.table_name_converter(m._meta.db_table) in tables
        ])

    def sequence_list(self):