Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 81d01e2

Browse files
author
Juanjo Alvarez
committed
Remove unneded ifs. Remove unused add parameter
1 parent 02db8f5 commit 81d01e2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

native/python_package/python_driver/astimprove.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _pop_token(self, lineno, token_value):
103103
raise TokenNotFoundException("Token named '{}' not found in line {}"
104104
.format(token_value, lineno))
105105

106-
def sync_node_pos(self, nodedict, add = 0):
106+
def sync_node_pos(self, nodedict):
107107
"""
108108
Check the column position, updating the column if needed (this changes the
109109
nodedict argument). Some Nodes have questionable column positions in the Python
@@ -137,14 +137,8 @@ def sync_node_pos(self, nodedict, add = 0):
137137
# position in that case is fine (uses the last line in that case)
138138
return
139139

140-
token_startline = token[TOKEN_STARTLOC][TOKENROW]
141-
if nodedict.get("lineno") != token_startline:
142-
nodedict["lineno"] = token_startline
143-
144-
token_startcolumn = token[TOKEN_STARTLOC][TOKENCOL]
145-
if nodedict.get('col_offset') != token_startcolumn:
146-
nodedict["col_offset"] = token_startcolumn + add
147-
140+
nodedict["lineno"] = token[TOKEN_STARTLOC][TOKENROW]
141+
nodedict["col_offset"] = token[TOKEN_STARTLOC][TOKENCOL]
148142
nodedict["end_lineno"] = token[TOKEN_ENDLOC][TOKENROW]
149143
nodedict["end_col_offset"] = token[TOKEN_ENDLOC][TOKENCOL]
150144

0 commit comments

Comments
 (0)