From 5005ff0e8e19e83dac8bf77ccc4f12c4ad4d63d9 Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Wed, 29 Dec 2021 21:34:25 +0900 Subject: [PATCH] Use unpack_from and pack_into for speedup --- others/planck.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/others/planck.py b/others/planck.py index 5c03404..1a8e393 100644 --- a/others/planck.py +++ b/others/planck.py @@ -6,9 +6,9 @@ import os import sys import operator -import ctypes +from ctypes import c_uint32 import platform -from struct import pack, unpack +from struct import pack_into, unpack_from RUNTIME_NAME = "Python {}".format(platform.python_version()) COPYRIGHT = "Copyright (c) 2021 Koichi Nakamura " @@ -39,13 +39,13 @@ def align(): write(HERE_CELL, aligned(read(HERE_CELL))) def readi(addr): - return unpack('