Bug Tracker

Modify

Ticket #6114 (closed enhancement: duplicate)

Opened 4 years ago

Last modified 4 years ago

fcleanup function perfomance speed up

Reported by: vamp Owned by:
Priority: undecided Milestone: 1.4.2
Component: event Version: 1.4.1
Keywords: fcleanup Cc: vamphouse@…
Blocking: Blocked by:

Description

return nm.replace(/[\w\s\.\|`]/g, function( ch ) {

return "
" + ch;

});

vs

nm.replace(/(?=[\w\s\.\|`])/g, '
');

Change History

comment:1 Changed 4 years ago by vamp

excuse me, "^" character was dropped from initial RegExp:  http://gyazo.com/cf062387ab1881de8771199fd5257e2f.png

comment:2 Changed 4 years ago by ridgerunner

A fix very similar to this one was recently implemented (See #7062). However, the fix recommended here might be even faster. Only benchmarking can tell...

comment:3 Changed 4 years ago by snover

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to duplicate

comment:4 Changed 4 years ago by snover

Duplicate of #7062.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.