1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 07:58:58 +01:00

Improve logic

This commit is contained in:
Daniil Gentili 2023-07-10 19:33:02 +02:00
parent 6b5d7ad909
commit e7d8c746cc
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -870,12 +870,7 @@ final class TL implements TLInterface
*/
public static function extractWaveform(string $x): array
{
$values = \array_values(\unpack('C*', $x));
$valuesLength = \count($values);
if ($valuesLength < 63) {
$addCount = 63 - $valuesLength;
\array_push($values, ...\array_fill(0, $addCount, 0));
}
$values = array_pad(\array_values(\unpack('C*', $x)), 63, 0);
$result = \array_fill(0, 100, 0);
$bitPos = 0;