minor optimization

This commit is contained in:
Miroslav Stampar 2011-10-25 13:21:01 +00:00
parent eaaf6041b9
commit 9523da7663

View File

@ -883,6 +883,9 @@ class Enumeration:
query += " WHERE " query += " WHERE "
query += " OR ".join("%s = '%s'" % (condition, unsafeSQLIdentificatorNaming(db)) for db in sorted(dbs)) query += " OR ".join("%s = '%s'" % (condition, unsafeSQLIdentificatorNaming(db)) for db in sorted(dbs))
if len(dbs) < 2 and ("%s," % condition) in query:
query = query.replace("%s," % condition, "", 1)
if Backend.isDbms(DBMS.MSSQL): if Backend.isDbms(DBMS.MSSQL):
query = safeStringFormat(query, conf.db) query = safeStringFormat(query, conf.db)