Change two local definitions from local functions to private methods.

For anyone who follows these commit messages, if now try drscheme you
should notice both memory and speed improvements: it will now use 8
bytes less per window (on a 64 bit machine), and each initialization
should be aroun 60 nanoseconds faster!

svn: r10591
This commit is contained in:
Eli Barzilay 2008-07-04 00:45:46 +00:00
parent dca304097b
commit da13b5f398

View File

@ -669,7 +669,7 @@ module browser threading seems wrong.
(not (is-modified?)) (not (is-modified?))
(not (get-filename)))) (not (get-filename))))
;; inserts the auto-text if any, and executes the text if so ;; inserts the auto-text if any, and executes the text if so
(define (insert-auto-text) (define/private (insert-auto-text)
(define lang (define lang
(drscheme:language-configuration:language-settings-language (drscheme:language-configuration:language-settings-language
next-settings)) next-settings))
@ -691,9 +691,10 @@ module browser threading seems wrong.
;; to find if the current text is the auto-text and analyze it to ;; to find if the current text is the auto-text and analyze it to
;; get this initialization, or it will need to do that for all ;; get this initialization, or it will need to do that for all
;; possible contents, which means that it'll work when opening ;; possible contents, which means that it'll work when opening
;; exiting files too. ;; exiting files too (it might be feasible once we have a #lang
;; parser).
(send (get-top-level-window) execute-callback))) (send (get-top-level-window) execute-callback)))
(define (remove-auto-text) (define/private (remove-auto-text)
(when (and (still-untouched?) (> (last-position) 0)) (when (and (still-untouched?) (> (last-position) 0))
(begin-edit-sequence #f) (begin-edit-sequence #f)
(send this erase) (send this erase)
@ -710,7 +711,7 @@ module browser threading seems wrong.
(super-new) (super-new)
;; insert the default-text ;; insert the default-text
(queue-callback insert-auto-text) (queue-callback (lambda () (insert-auto-text)))
(inherit set-max-undo-history) (inherit set-max-undo-history)
(set-max-undo-history 'forever)))) (set-max-undo-history 'forever))))