Skip to content

Commit 4d70d00

Browse files
committed
Replaced a loop with a map
* The performance remains the same. * The source code is more readable.
1 parent 1953399 commit 4d70d00

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

control/statesp.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ def __init__(self, *args):
124124

125125
# Here we're going to convert inputs to matrices, if the user gave a
126126
# non-matrix type.
127-
#! TODO: [A, B, C, D] = map(matrix, [A, B, C, D])?
128-
matrices = [A, B, C, D]
129-
for i in range(len(matrices)):
130-
# Convert to matrix first, if necessary.
131-
matrices[i] = matrix(matrices[i])
132-
[A, B, C, D] = matrices
127+
A, B, C, D = map(matrix, [A, B, C, D])
133128

134129
LTI.__init__(self, B.shape[1], C.shape[0], dt)
135130
self.A = A

0 commit comments

Comments
 (0)