Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7bdb319bbf7579aedace171b8e3453d2489885e3
Ticket: 1764318fffffffffffffffffffffffffffffffff
Improve performance of tcl_startOfNextWord and friends...
User & Date: dkf on 2007-08-01 22:21:36
Changes

  1. assignee changed to: "dkf"
  2. closedate changed to: "2007-08-01T15:21:36"
  3. closer changed to: "dkf"
  4. icomment:
    Logged In: YES 
    user_id=79902
    Originator: NO
    
    Reworked so that code is much more efficient (avoids repeated recompilation of regular expressions, uses -start, etc.) To illustrate, here's the committed version of tcl_startOfNextWord:
      proc tcl_startOfNextWord {str start} {
          variable ::tcl::WordBreakRE
          set result {-1 -1}
          regexp -indices -start $start $WordBreakRE(next) $str result
          return [lindex $result 1]
      }
    That's about as efficient as we're going to get. :-)
    
    Note that not all operations can take full advantage of the efficiency gains. Can't be helped.
    
    
  5. login: "dkf"
  6. mimetype: "text/plain"
  7. resolution changed to: "Fixed"
  8. status changed to: "Closed"
  9. username: "dkf"