Skip to content

Commit

Permalink
Optimize import.
Browse files Browse the repository at this point in the history
Do not import whole functools just for reduce, import only reduce instead.
  • Loading branch information
denpamusic committed Oct 20, 2023
1 parent e4fa8ce commit 50828f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyplumio/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Contains various utility methods."""
from __future__ import annotations

import functools
from functools import reduce
import struct

# Data type unpackers.
Expand Down Expand Up @@ -30,7 +30,7 @@ def unpack_string(data: bytearray, offset: int = 0) -> str:

def bcc(data: bytes) -> int:
"""Return a block check character."""
return functools.reduce(lambda x, y: x ^ y, data)
return reduce(lambda x, y: x ^ y, data)


def to_camelcase(text: str, overrides: dict[str, str] = None) -> str:
Expand Down

0 comments on commit 50828f5

Please sign in to comment.