Skip to content

Commit 2c29354

Browse files
jpereira-DevmatheusvirManoelNetto26Predd0oLucaslg7
committed
perf(python-dotenv): replace findall with str-count in advance
Co-authored-by: Matheus Virgolino <matheus.virgolino.abilio.da.silva@ccc.ufcg.edu.br> Co-authored-by: Manoel Netto <manoel.da.nobrega.eustaqueo.netto@ccc.ufcg.edu.br> Co-authored-by: Pedro <pedroalmeida1896@gmail.com> Co-authored-by: Lucaslg7 <lucasmoizinholg7@gmail.com> Co-authored-by: RailtonDantas <railtondantas.code@gmail.com> Co-authored-by: João Pereira <joao.pereira.de.oliveira@ccc.ufcg.edu.br>
1 parent fa4e6a9 commit 2c29354

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotenv/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def set(self, other: "Position") -> None:
5959

6060
def advance(self, string: str) -> None:
6161
self.chars += len(string)
62-
self.line += len(re.findall(_newline, string))
62+
self.line += string.count("\n") + string.count("\r") - string.count("\r\n")
6363

6464

6565
class Error(Exception):

0 commit comments

Comments
 (0)