diff src/DLD-FUNCTIONS/bsxfun.cc @ 10294:816b91eebe79

remove redundant test in bsxfun
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 10 Feb 2010 07:58:13 +0100
parents 40dfc0c99116
children 12884915a8e4
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/bsxfun.cc	Wed Feb 10 07:57:43 2010 +0100
+++ b/src/DLD-FUNCTIONS/bsxfun.cc	Wed Feb 10 07:58:13 2010 +0100
@@ -347,10 +347,12 @@
       const octave_value B = args (2);
 
       if (func.is_builtin_function () 
-          || (func.is_function_handle () 
-              && ! func.fcn_handle_value ()->is_overloaded () 
-              && ! A.is_object () && ! B.is_object ()))
+          || (func.is_function_handle () && ! A.is_object () && ! B.is_object ()))
         {
+          // This may break if the default behavior is overriden. But if you override
+          // arithmetic operators for builtin classes, you should expect mayhem
+          // anyway (constant folding etc). Querying is_overloaded may not be
+          // exactly what we need here.
           octave_function *fcn_val = func.function_value ();
           if (fcn_val)
             {