Skip to content

Commit 1ede875

Browse files
FIX: Useless return detected [PYL-R1711] (HarshCasper#1273)
1 parent faeab73 commit 1ede875

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Python/Execution_Time/stopwatch.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ def __init__(self, precision=None):
1717
else:
1818
# Default to tenths of a second.
1919
self.__precision__ = 1
20-
return
2120

2221
def start(self):
2322
# Start the stopwatch.
2423
if not self.state == "Stopped":
2524
print("Stopwatch is already running.")
26-
return
25+
return None
26+
2727
self.__startTime__ = time.time()
2828
self.state = "Started"
29-
return
3029

3130
def lap(self):
3231
# Start tracking a new lap.
@@ -35,7 +34,6 @@ def lap(self):
3534
self.__currentLap__ = 0
3635
self.__startTime__ = time.time()
3736
self.__update__()
38-
return
3937

4038
def stop(self):
4139
# Stop/Pause the stopwatch without clearing it.
@@ -44,7 +42,6 @@ def stop(self):
4442
else:
4543
self.__update__()
4644
self.state = "Stopped"
47-
return
4845

4946
def reset(self):
5047
# Reset the entire stopwatch back to zero.
@@ -53,7 +50,6 @@ def reset(self):
5350
self.laps = []
5451
self.summary = None
5552
self.state = "Stopped"
56-
return
5753

5854
def __update__(self):
5955
# Internal function to update stopwatch summary.
@@ -92,5 +88,4 @@ def __update__(self):
9288
seconds=round(self.__currentLap__, self.__precision__)
9389
)
9490
).rjust(7)
95-
)
96-
return
91+
)

Python/Subdomain_Finder/subdomain_finder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ def readTextFile(textFilename):
1414
inputFile = open(os.path.join(sys.path[0], textFilename), "r")
1515
available_subdomains = inputFile.read().splitlines()
1616

17-
inputFile.close()
18-
return
19-
20-
17+
inputFile.close()\
18+
2119
def findSubdomains(userDomain, available_subdomains, size):
2220
"""This function is used to find possible subdomains"""
2321
subdomains = []

0 commit comments

Comments
 (0)