aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/midi
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-09 22:50:28 -0700
committerChris Robinson <[email protected]>2014-04-09 22:50:28 -0700
commit90ae4b7c0f675e0a0846af376f6025ccfd8f7bc9 (patch)
treed9db59c53037cf91753dca6193cec536d0f8a8e3 /Alc/midi
parent023981acb9242649f1fff8b02143a26e85005a9f (diff)
Add a VECTOR_INSERT method to insert a range of elements at once
Diffstat (limited to 'Alc/midi')
-rw-r--r--Alc/midi/sf2load.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c
index 1c7cc10b..91e68d7d 100644
--- a/Alc/midi/sf2load.c
+++ b/Alc/midi/sf2load.c
@@ -346,20 +346,16 @@ static void GenModList_Destruct(GenModList *self)
static GenModList GenModList_clone(const GenModList *self)
{
- ALsizei count, i;
GenModList ret;
GenModList_Construct(&ret);
- count = VECTOR_SIZE(self->gens);
- VECTOR_RESERVE(ret.gens, count);
- for(i = 0;i < count;i++)
- VECTOR_PUSH_BACK(ret.gens, VECTOR_ELEM(self->gens, i));
-
- count = VECTOR_SIZE(self->mods);
- VECTOR_RESERVE(ret.mods, count);
- for(i = 0;i < count;i++)
- VECTOR_PUSH_BACK(ret.mods, VECTOR_ELEM(self->mods, i));
+ VECTOR_INSERT(ret.gens, VECTOR_ITER_END(ret.gens),
+ VECTOR_ITER_BEGIN(self->gens), VECTOR_ITER_END(self->gens)
+ );
+ VECTOR_INSERT(ret.mods, VECTOR_ITER_END(ret.mods),
+ VECTOR_ITER_BEGIN(self->mods), VECTOR_ITER_END(self->mods)
+ );
return ret;
}