ref: 396103a699e2b71d501e282457c2e52faf3d9e95
parent: ba507ff3b5162024e3a14ebdcd4079ef8f89380f
author: Paul Brossier <piem@piem.org>
date: Mon Mar 18 06:46:42 EDT 2013
src/fvec.c: fvec_copy: only get min if needed
--- a/src/fvec.c
+++ b/src/fvec.c
@@ -87,13 +87,13 @@
void fvec_copy(fvec_t *s, fvec_t *t) {
uint_t j;
- uint_t length = MIN(s->length, t->length);
+ uint_t length = t->length;
if (s->length != t->length) {
- AUBIO_WRN("trying to copy %d elements to %d elements \n",
- s->length, t->length);
+ AUBIO_WRN("trying to copy %d elements to %d elements \n",
+ s->length, t->length);
+ length = MIN(s->length, t->length);
}
for (j=0; j< length; j++) {
t->data[j] = s->data[j];
}
}
-