changeset 18898:c677d9bd6bac

exist: Don't look up name in symbol table if "file" or "dir" specified. * variables.cc (symbol_exist): Check that "builtin" or "any" is specified before searching symbol table for name.
author Rik <rik@octave.org>
date Thu, 26 Jun 2014 09:02:01 -0700
parents 6825522c25e4
children a0fd65914811
files libinterp/corefcn/variables.cc
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc	Wed Jun 25 15:06:36 2014 -0700
+++ b/libinterp/corefcn/variables.cc	Thu Jun 26 09:02:01 2014 -0700
@@ -414,12 +414,13 @@
   // We shouldn't need to look in the global symbol table, since any name
   // that is visible in the current scope will be in the local symbol table.
 
-  octave_value val = safe_symbol_lookup (name);
-
-  if (val.is_defined ())
+  octave_value val;
+
+  if (search_any || search_builtin)
     {
-      if ((search_any || search_builtin)
-          && val.is_builtin_function ())
+      val = safe_symbol_lookup (name);
+
+      if (val.is_defined () && val.is_builtin_function ())
         return 5;
 
       if (search_builtin)