Skip to content

Commit

Permalink
Simplify some code (no functional change)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjensen committed Mar 1, 2018
1 parent 7d0907e commit fa63936
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 6 additions & 6 deletions lib/Vend/Data.pm
@@ -1,6 +1,6 @@
# Vend::Data - Interchange databases
#
# Copyright (C) 2002-2017 Interchange Development Group
# Copyright (C) 2002-2018 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
#
# This program was originally based on Vend 0.2 and 0.3
Expand Down Expand Up @@ -2282,11 +2282,11 @@ sub update_data {
if $::Pragma->{dml} eq 'strict'
|| $function eq 'insert' && $::Pragma->{dml} eq 'preserve';

for(keys %$qd) {
#::logDebug("update_data: Getting ready to set_slice");
my $k = $multikey ? undef : $key;
$qret = $qd->{$_}->set_slice([$dml, $k], $qf->{$_}, $qv->{$_});
$rows_set[$i] = $qret unless $rows_set[$i];
my $k = $multikey ? undef : $key;
my $args = [$dml, $k];
for (keys %$qd) {
$qret = $qd->{$_}->set_slice($args, $qf->{$_}, $qv->{$_});
$rows_set[$i] ||= $qret;
}
if($blob && $rows_set[$i]) {
$brec->{mv_data_fields} = join " ", @fields;
Expand Down
12 changes: 4 additions & 8 deletions lib/Vend/Table/Editor.pm
@@ -1,6 +1,6 @@
# Vend::Table::Editor - Swiss-army-knife table editor for Interchange
#
# Copyright (C) 2002-2016 Interchange Development Group
# Copyright (C) 2002-2018 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike@perusion.net>
#
# This program was originally based on Vend 0.2 and 0.3
Expand Down Expand Up @@ -2334,6 +2334,7 @@ show_times("begin table editor call item_id=$key") if $Global::ShowTimes;
}
}
}
#::logDebug("table editor multikey/key/data=\n" . ::uneval($multikey, $key, $data));

my $regin = $opt->{all_opts} ? 1 : 0;

Expand Down Expand Up @@ -2622,13 +2623,8 @@ EOF
}
}

my $keycol;
if($opt->{notable}) {
$keycol = $opt->{ui_data_key_name};
}
else {
$keycol = $opt->{ui_data_key_name} || $db->config('KEY');
}
my $keycol = $opt->{ui_data_key_name};
$keycol ||= $db->config('KEY') if !$opt->{notable};

###############################################################

Expand Down

0 comments on commit fa63936

Please sign in to comment.