From d7d301c773beb312be752accf7018a3dacecde02 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Nov 2022 10:12:57 +0100 Subject: [PATCH] feat: speed up marshall align (#137) --- src/dbus_fast/_private/marshaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbus_fast/_private/marshaller.py b/src/dbus_fast/_private/marshaller.py index 8ec71be..abd886d 100644 --- a/src/dbus_fast/_private/marshaller.py +++ b/src/dbus_fast/_private/marshaller.py @@ -31,7 +31,8 @@ class Marshaller: offset = n - len(self._buf) % n if offset == 0 or offset == n: return 0 - self._buf.extend(bytes(offset)) + for _ in range(offset): + self._buf.append(0) return offset def write_boolean(self, boolean: bool, type_: SignatureType) -> int: