(FILECREATED " 5-Feb-85 00:28:28" {PHYLUM}<NOTECARDS>RELEASE1.1>FGHPATCH3.;1 1301   

      changes to:  (VARS FGHPATCH3COMS)
		   (FNS NC.ComputeNewDatabaseIndexSize))


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT FGHPATCH3COMS)

(RPAQQ FGHPATCH3COMS ((FNS NC.ComputeNewDatabaseIndexSize)))
(DEFINEQ

(NC.ComputeNewDatabaseIndexSize
  (LAMBDA (FromStream)                                       (* fgh: " 5-Feb-85 00:25")

          (* If the number of notecards we have is more than 3/4 the size of the index, double the index size;
	  otherwise just keep the same size)


    (PROG (NumberOfCurrentIndices CurrentIndexSize)
          (SETFILEPTR FromStream 0)
          (SETQ NumberOfCurrentIndices (NC.GetPtr FromStream 2))
          (SETQ CurrentIndexSize (NC.GetPtr FromStream 2))
          (COND
	    ((GREATERP NumberOfCurrentIndices (FIX (TIMES .75 CurrentIndexSize)))
	      (RETURN (ITIMES 2 CurrentIndexSize)))
	    ((GREATERP CurrentIndexSize (ITIMES 2 NumberOfCurrentIndices))
	      (RETURN (MAX 1000 (ITIMES 2 NumberOfCurrentIndices))))
	    (T (RETURN CurrentIndexSize))))))
)
(PUTPROPS FGHPATCH3 COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (341 1221 (NC.ComputeNewDatabaseIndexSize 351 . 1219)))))
STOP