Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48d7e852f6bdf357c718763b54cd3e25537fbdb9
Ticket: d2323d6c284a5081e818dc02f0bbe695a7aa1c61
add parameter ?lastIndex? to [string first]
User & Date: anonymous on 2016-02-25 14:33:02
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    The dubious implementation of tcllib's ::textutil::trim::trimPrefix caught my eye. Why scan the full string when actually looking at the start only?
    
    % set haystack [string repeat abc 1000]d
    % set needle abcd
    % string first $needle $haystack
    2997
    % time {string first $needle $haystack} 1000
    10.149 microseconds per iteration
    % time {string first $needle $haystack 0 0} 1000
    0.712 microseconds per iteration
    
    In this form, I cannot attach my patch file. Will attach or post after creating this ticket. The patch is for the implementation and the tests, not for the documentation.
    
  5. foundin changed to: "8.6.4"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "5ef84f1ed636fd4b80333e656cf7dfe1164a9802"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "18. Commands M-Z"
  15. title changed to: "add parameter ?lastIndex? to [string first]"
  16. type changed to: "Patch"