http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184

--- Comment #5 from M. Tompsett <[email protected]> ---
The fix:
    my $newentry = { %$entry };
takes the hash and generates a copy. This is what:
    my $newentry = { map { $_ => $entry->{$_} } %$entry };
is supposed to do, but it does it wrong.

It could be fixed by making it:
    my $newentry = { map { $_ => $entry->{$_} } keys %$entry };
However, mapping and access functions to copy are much likely to be slower than
just straight copying.

Instead of copying
    { k1 => v1, k2 => v2, ..., kn => vn }
The broken code generates
    { k1 => v1, v1 => undef, k2 => v2, v2 => undef, ... kn => vn, vn => undef }
This can create some weird errors if the value of any of those keys is undef.
This is also twice the size of the hash.

And yes, this fix should be applied to the other line as well.

Hope this clarifies, Katrin.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to