Skip to content

Commit

Permalink
Updated line number calculation to use splitlines() instead of split(…
Browse files Browse the repository at this point in the history
…'\n').
  • Loading branch information
Xenomega committed Mar 30, 2019
1 parent ad4fc1b commit 8f13315
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slither/core/source_mapping/source_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def _compute_line(source_code, start, length):
Not done in an efficient way
"""
total_length = len(source_code)
source_code = source_code.split('\n')
source_code = source_code.splitlines(True)
counter = 0
i = 0
lines = []
while counter < total_length:
counter += len(source_code[i]) +1
counter += len(source_code[i])
i = i+1
if counter > start:
lines.append(i)
Expand Down

0 comments on commit 8f13315

Please sign in to comment.