mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
89219a6829
commit
ed51dd5d64
|
@ -631,8 +631,10 @@ class BaseDatabaseIntrospection(object):
|
||||||
for model in models.get_models(app):
|
for model in models.get_models(app):
|
||||||
if router.allow_syncdb(self.connection.alias, model):
|
if router.allow_syncdb(self.connection.alias, model):
|
||||||
all_models.append(model)
|
all_models.append(model)
|
||||||
return set([m for m in all_models
|
tables = map(self.table_name_converter, tables)
|
||||||
if self.table_name_converter(m._meta.db_table) in 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):
|
def sequence_list(self):
|
||||||
|
|
Loading…
Reference in New Issue