mirror of https://github.com/django/django.git
Avoided assignment followed by immediate return.
Identified using the following command: $ pcre2grep --line-number --multiline --recursive \ "(?s)(\n +)(\w+) = [^\n]+\1return \2;?$" \ django docs extras js_tests scripts tests
This commit is contained in:
parent
d3cb91db87
commit
2bc47d7fe9
|
@ -26,13 +26,11 @@
|
|||
}
|
||||
|
||||
function addPopupIndex(name) {
|
||||
name = name + "__" + (popupIndex + 1);
|
||||
return name;
|
||||
return name + "__" + (popupIndex + 1);
|
||||
}
|
||||
|
||||
function removePopupIndex(name) {
|
||||
name = name.replace(new RegExp("__" + (popupIndex + 1) + "$"), '');
|
||||
return name;
|
||||
return name.replace(new RegExp("__" + (popupIndex + 1) + "$"), '');
|
||||
}
|
||||
|
||||
function showAdminPopup(triggeringLink, name_regexp, add_popup) {
|
||||
|
|
|
@ -163,8 +163,7 @@
|
|||
s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
|
||||
s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens
|
||||
s = s.substring(0, num_chars); // trim to first num_chars chars
|
||||
s = s.replace(/-+$/g, ''); // trim any trailing hyphens
|
||||
return s;
|
||||
return s.replace(/-+$/g, ''); // trim any trailing hyphens
|
||||
}
|
||||
window.URLify = URLify;
|
||||
}
|
||||
|
|
|
@ -110,8 +110,7 @@ class Polygon(GEOSGeometry):
|
|||
if isinstance(param, LinearRing):
|
||||
return param
|
||||
try:
|
||||
ring = LinearRing(param)
|
||||
return ring
|
||||
return LinearRing(param)
|
||||
except TypeError:
|
||||
raise TypeError(msg)
|
||||
|
||||
|
|
|
@ -1027,8 +1027,7 @@ class ETagGZipMiddlewareTest(SimpleTestCase):
|
|||
"""
|
||||
|
||||
def get_response(req):
|
||||
response = HttpResponse(self.compressible_string)
|
||||
return response
|
||||
return HttpResponse(self.compressible_string)
|
||||
|
||||
def get_cond_response(req):
|
||||
return ConditionalGetMiddleware(get_response)(req)
|
||||
|
|
|
@ -156,8 +156,7 @@ class TestSuiteTests(SimpleTestCase):
|
|||
def make_tests(self):
|
||||
"""Return an iterable of tests."""
|
||||
suite = self.make_test_suite()
|
||||
tests = list(iter_test_cases(suite))
|
||||
return tests
|
||||
return list(iter_test_cases(suite))
|
||||
|
||||
def test_shuffle_tests(self):
|
||||
tests = self.make_tests()
|
||||
|
|
Loading…
Reference in New Issue