changeset 21529:8d894e463de6

doc_cache_create.m: Tweak docstring, improve performance. * doc_cache_create.m: List explicitly what will be created if no directory is given. Improve performance by using strncmp. Correct typo in comment.
author Rik <rik@octave.org>
date Thu, 24 Mar 2016 15:23:51 -0700
parents ffbd3e86e0be
children 7c143e73e921
files scripts/help/doc_cache_create.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/help/doc_cache_create.m	Tue Mar 22 23:14:20 2016 -0700
+++ b/scripts/help/doc_cache_create.m	Thu Mar 24 15:23:51 2016 -0700
@@ -30,7 +30,7 @@
 ## @file{doc-cache} if not given.
 ##
 ## If no directory is given (or it is the empty matrix), a cache for built-in
-## operators, etc. is generated.
+## functions, operators, and keywords is generated.
 ##
 ## @seealso{doc_cache_file, lookfor, path}
 ## @end deftypefn
@@ -67,8 +67,8 @@
 
 function [text, first_sentence, status] = handle_function (f, text, format)
   first_sentence = "";
-  ## Skip functions that start with __ as these shouldn't be searched by lookfor
-  if (length (f) > 2 && all (f (1:2) == "_"))
+  ## Skip internal functions starting with "__"
+  if (strncmp (f, "__", 2))
     status = 1;
     return;
   endif
@@ -142,7 +142,7 @@
   ## concatenate results
   cache = [cache{:}];
 
-  ## remove dirs form path
+  ## remove dirs from path
   if (! isempty (dirs_notpath))
     rmpath (dirs_notpath{:});
   endif