changeset 10241:a277ba5da4dc

filter.cc: return early if X is empty
author John W. Eaton <jwe@octave.org>
date Tue, 02 Feb 2010 01:23:23 -0500
parents fa7b5751730c
children 4acae5e46738
files src/ChangeLog src/DLD-FUNCTIONS/filter.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-02  John W. Eaton  <jwe@octave.org>
+
+	* DLD-FUNCTIONS/filter.cc (filter (MArray<T>&, MArray<T>&,
+	MArrayN<T>&, MArrayN<T>&, int)): Return early if X is empty.
+
 2010-02-02  John W. Eaton  <jwe@octave.org>
 
 	* cutils.c: Include <sys/times.h>, not "systime.h".
--- a/src/DLD-FUNCTIONS/filter.cc
+++ b/src/DLD-FUNCTIONS/filter.cc
@@ -117,6 +117,9 @@
         }
     }
 
+  if (x_len == 0)
+    return x;
+
   if (norm != static_cast<T>(1.0))
     {
       a = a / norm;