Skip to content

Commit

Permalink
fix tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Dec 13, 2023
1 parent 3794ae4 commit c879287
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions lib/GDPR/IAB/TCFv2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,16 @@ sub _parse_vendor_legitimate_interests {
sub _parse_publisher_restrictions {
my ( $self, $pub_restrict_offset ) = @_;

my $data = substr($self->{data}, $pub_restrict_offset, ASSUMED_MAX_VENDOR_ID);

my ($publisher_restrictions, $relative_next_offset) = GDPR::IAB::TCFv2::PublisherRestrictions->Parse(
data => $data,
data_size => length($self->{data}),
max_id => ASSUMED_MAX_VENDOR_ID,
options => $self->{options},
);
my $data =
substr( $self->{data}, $pub_restrict_offset, ASSUMED_MAX_VENDOR_ID );

my ( $publisher_restrictions, $relative_next_offset ) =
GDPR::IAB::TCFv2::PublisherRestrictions->Parse(
data => $data,
data_size => length( $self->{data} ),
max_id => ASSUMED_MAX_VENDOR_ID,
options => $self->{options},
);

$self->{publisher_restrictions} = $publisher_restrictions;

Expand Down Expand Up @@ -545,33 +547,39 @@ sub _is_vendor_consent_range_encoding {
sub _parse_range_section {
my ( $self, $max_id, $range_section_start_offset ) = @_;

my $data = substr($self->{data}, $range_section_start_offset, $max_id);
my $data = substr( $self->{data}, $range_section_start_offset, $max_id );

my ( $range_section, $next_offset ) =
GDPR::IAB::TCFv2::RangeSection->Parse(
data => $data,
data_size => length($self->{data}),
offset => 0,
max_id => $max_id,
options => $self->{options},
data => $data,
data_size => length( $self->{data} ),
offset => 0,
max_id => $max_id,
options => $self->{options},
);

return wantarray ? ( $range_section, $range_section_start_offset +$next_offset ) : $range_section;
return
wantarray
? ( $range_section, $range_section_start_offset + $next_offset )
: $range_section;
}

sub _parse_bitfield {
my ( $self, $max_id, $bitfield_start_offset ) = @_;

my $data = substr($self->{data}, $bitfield_start_offset, $max_id);
my $data = substr( $self->{data}, $bitfield_start_offset, $max_id );

my ( $bitfield, $next_offset ) = GDPR::IAB::TCFv2::BitField->Parse(
data => $data,
data_size => length($self->{data}),
max_id => $max_id,
options => $self->{options},
data => $data,
data_size => length( $self->{data} ),
max_id => $max_id,
options => $self->{options},
);

return wantarray ? ( $bitfield, $bitfield_start_offset + $next_offset ) : $bitfield;
return
wantarray
? ( $bitfield, $bitfield_start_offset + $next_offset )
: $bitfield;
}

sub looksLikeIsConsentVersion2 {
Expand Down

0 comments on commit c879287

Please sign in to comment.