From 41085ccc68c1ab504f535a5a5bc626fc5cced04f Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Tue, 12 Dec 2023 16:09:24 +0100 Subject: [PATCH] increase performance in 17% on TO_JSON method when it is bitfield by limit data size --- lib/GDPR/IAB/TCFv2/BitField.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GDPR/IAB/TCFv2/BitField.pm b/lib/GDPR/IAB/TCFv2/BitField.pm index 25912c4..c545a94 100644 --- a/lib/GDPR/IAB/TCFv2/BitField.pm +++ b/lib/GDPR/IAB/TCFv2/BitField.pm @@ -35,7 +35,7 @@ sub Parse { my $self = { # TODO consider store data as arrayref of bits - data => substr( $data, $offset ), + data => substr( $data, $offset, $max_id ), max_id => $max_id, options => $options, };