Skip to content

Commit 8092551

Browse files
committed
Minor refactoring
1 parent 83972d4 commit 8092551

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

lib/core/common.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,16 @@ def readXmlFile(xmlFile):
21212121

21222122
return retVal
21232123

2124+
def average(values):
2125+
"""
2126+
Computes the arithmetic mean of a list of numbers.
2127+
2128+
>>> average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9])
2129+
0.9
2130+
"""
2131+
2132+
return (sum(values) / len(values)) if values else None
2133+
21242134
@cachedmethod
21252135
def stdev(values):
21262136
"""
@@ -2135,19 +2145,9 @@ def stdev(values):
21352145
return None
21362146
else:
21372147
avg = average(values)
2138-
_ = reduce(lambda x, y: x + pow((y or 0) - avg, 2), values, 0.0)
2148+
_ = 1.0 * sum(pow((_ or 0) - avg, 2) for _ in values)
21392149
return sqrt(_ / (len(values) - 1))
21402150

2141-
def average(values):
2142-
"""
2143-
Computes the arithmetic mean of a list of numbers.
2144-
2145-
>>> average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9])
2146-
0.9
2147-
"""
2148-
2149-
return (sum(values) / len(values)) if values else None
2150-
21512151
def calculateDeltaSeconds(start):
21522152
"""
21532153
Returns elapsed time from start till now

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.12.42"
22+
VERSION = "1.2.12.43"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ d4582467b0735525d8d8bdc0396ec87f lib/controller/checks.py
2929
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
3030
e62309b22a59e60b270e62586f169441 lib/core/agent.py
3131
c347f085bd561adfa26d3a9512e5f3b9 lib/core/bigarray.py
32-
22eb6444f89ef013cd256c92771cff5a lib/core/common.py
32+
7272b591e710224c578071381e28c6c5 lib/core/common.py
3333
0d082da16c388b3445e656e0760fb582 lib/core/convert.py
3434
9f87391b6a3395f7f50830b391264f27 lib/core/data.py
3535
72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py
@@ -49,7 +49,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
4949
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
5050
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5151
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
52-
6781c2fdbfdac0ec5388ca9f06b89b64 lib/core/settings.py
52+
2e1f9bb9dce79f8681b8e1c83591d346 lib/core/settings.py
5353
a971ce157d04de96ba6e710d3d38a9a8 lib/core/shell.py
5454
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5555
1581be48127a3a7a9fd703359b6e7567 lib/core/target.py

0 commit comments

Comments
 (0)