﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28906	Reduce calls to bool()	Дилян Палаузов	nobody	"Compared to the attached patch, these changes might be more controversial:
{{{
diff --git a/django/contrib/gis/db/backends/spatialite/features.py b/django/contrib/gis/db/backends/spatialite/features
--- a/django/contrib/gis/db/backends/spatialite/features.py
+++ b/django/contrib/gis/db/backends/spatialite/features.py
@@ -10,4 +10,4 @@ class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures):
 
     @cached_property
     def supports_area_geodetic(self):
-        return bool(self.connection.ops.lwgeom_version())
+        return self.connection.ops.lwgeom_version()
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -51,7 +51,7 @@ class SQLCompiler:
         order_by = self.get_order_by()
         self.where, self.having = self.query.where.split_having()
         extra_select = self.get_extra_select(order_by, self.select)
-        self.has_extra_select = bool(extra_select)
+        self.has_extra_select = extra_select
         group_by = self.get_group_by(self.select + extra_select, order_by)
         return extra_select, order_by, group_by
 @@ -1216,11 +1216,10 @@ class SQLInsertCompiler(SQLCompiler):
         insert_statement = self.connection.ops.insert_statement(on_conflict=self.query.on_conflict)
         result = ['%s %s' % (insert_statement, qn(opts.db_table))]
 
-        has_fields = bool(self.query.fields)
-        fields = self.query.fields if has_fields else [opts.pk]
+        fields = self.query.fields or [opts.pk]
         result.append('(%s)' % ', '.join(qn(f.column) for f in fields))
 
-        if has_fields:
+        if self.query.fields:
             value_rows = [
                 [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
                 for obj in self.query.objs
}}}"	Cleanup/optimization	closed	Core (Other)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
