Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1d96e961

Von Sven Schöling vor mehr als 4 Jahren hinzugefügt

  • ID 1d96e96182f306f5f4eba8861960e772578d564a
  • Vorgänger 1dcd3e10
  • Nachfolger e6291c8b

Inventory: with_objects cleanup

Unterschiede anzeigen:

SL/Helper/Inventory.pm
for my $with_object (listify($params{with_objects})) {
Carp::croak("unknown with_object $with_object") if !exists $with_objects{$with_object};
if (my $manager = $with_objects{$with_object}) {
my $slot = $slots{$with_object};
next if !(my @ids = map { $_->{$slot} } @$results);
my $objects = $manager->get_all(query => [ id => \@ids ]);
my %objects_by_id = map { $_->id => $_ } @$objects;
$_->{$with_object} = $objects_by_id{$_->{$slot}} for @$results;
} else {
# need to fetch all partitions
}
my $manager = $with_objects{$with_object};
my $slot = $slots{$with_object};
next if !(my @ids = map { $_->{$slot} } @$results);
my $objects = $manager->get_all(query => [ id => \@ids ]);
my %objects_by_id = map { $_->id => $_ } @$objects;
$_->{$with_object} = $objects_by_id{$_->{$slot}} for @$results;
}
}

Auch abrufbar als: Unified diff