Method: pylint.checkers.unicode._remove_bom
Calls: 1289, Exceptions: 0, Paths: 3Back
Path 1: 1170 calls (0.91)
bytes (1170)
'utf-8' (1072) 'utf-16le' (28) 'utf-32le' (28) 'utf-16be' (21) 'utf-32be' (21)
bytes (1170)
1def _remove_bom(encoded: bytes, encoding: str) -> bytes:
2 """Remove the bom if given from a line."""
3 if encoding not in UNICODE_BOMS:
4 return encoded
5 bom = UNICODE_BOMS[encoding]
6 if encoded.startswith(bom):
7 return encoded[len(bom) :]
8 return encoded
Path 2: 76 calls (0.06)
bytes (76)
'utf-16' (31) 'utf-32' (31) 'utf-16le' (7) 'utf-32le' (7)
bytes (76)
1def _remove_bom(encoded: bytes, encoding: str) -> bytes:
2 """Remove the bom if given from a line."""
3 if encoding not in UNICODE_BOMS:
4 return encoded
5 bom = UNICODE_BOMS[encoding]
6 if encoded.startswith(bom):
7 return encoded[len(bom) :]
8 return encoded
Path 3: 43 calls (0.03)
bytes (43)
'iso-8859-1' (17) 'ascii' (15) 'utf' (11)
bytes (43)
1def _remove_bom(encoded: bytes, encoding: str) -> bytes:
2 """Remove the bom if given from a line."""
3 if encoding not in UNICODE_BOMS:
4 return encoded
5 bom = UNICODE_BOMS[encoding]
6 if encoded.startswith(bom):
7 return encoded[len(bom) :]
8 return encoded