summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-02-06 01:09:04 +1100
committernick_m <mainsbridge@gmail.com>2015-02-06 01:09:04 +1100
commit63935a86a49ce647084fb9c72d18f7ec09b7608f (patch)
tree888dcd99f6822d41887d8095af9c7c7f5d5af408 /libs/ardour/midi_model.cc
parent2d8b7c352bb6d1234d655b6b7a50a8d3c1ea608e (diff)
Rework previous commit to avoid extra property lookup (fwiw).
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r--libs/ardour/midi_model.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 06ea307664..7e88569adc 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -1236,14 +1236,15 @@ MidiModel::PatchChangePtr
MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
{
XMLProperty* prop;
+ XMLProperty* prop_id;
Evoral::event_id_t id = 0;
Evoral::Beats time = Evoral::Beats();
int channel = 0;
int program = 0;
int bank = 0;
- if ((prop = n->property ("id")) != 0) {
- istringstream s (prop->value());
+ if ((prop_id = n->property ("id")) != 0) {
+ istringstream s (prop_id->value());
s >> id;
}
@@ -1268,7 +1269,7 @@ MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
}
PatchChangePtr p (new Evoral::PatchChange<TimeType> (time, channel, program, bank));
- assert(n->property ("id"));
+ assert(prop_id);
p->set_id (id);
return p;
}