Skip to content

Commit fd5bda4

Browse files
maxim-s-barabashKOLANICH
authored andcommitted
refactoring
1 parent 8cd9c0a commit fd5bda4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Coco/Trace.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,8 @@ def formatString( s:str, w:int ):
4747
the string is left-adjusted if w < 0 and right-adjusted otherwise'''
4848
assert isinstance( s, str )
4949
assert isinstance( w, int )
50-
51-
size = len(s)
52-
b = ''
53-
if w >= 0:
54-
b += ' ' * (w - size)
55-
return b + s
56-
else:
57-
for i in range( w, -size ):
58-
b += ' '
59-
return s + b
50+
b = ' ' * (abs(w) - len(s))
51+
return b + s if w >= 0 else s + b
6052

6153
@staticmethod
6254
def Write( s:str, w:int=None ):

0 commit comments

Comments
 (0)