Changeset a62c2495929c711250849813eef31fd7c4dd933b
- Timestamp:
- 08/07/2008 03:08:17 PM
(5 months ago)
- Author:
- Robin Luckey <robin@ohloh.net>
- git-committer:
- Robin Luckey <robin@ohloh.net> 1218146897 -0700
- git-parent:
[b84f28ccae360885b9f151154e3e58c26729250e]
- git-author:
- Robin Luckey <robin@ohloh.net> 1218146897 -0700
- Message:
[CHANGE] Cut the feature to remove trailing punctuation from comments, since it can lead to runaway regex CPU churn
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| red5b0a7 |
ra62c249 |
|
| 66 | 66 | text = sfc.contents[s...e] # e is non-inclusive, so use ... |
|---|
| 67 | 67 | text.split(/[\r\n\f]+/).each do |line| |
|---|
| 68 | | # Strip leading punctuation. Also strip trailing punctuation |
|---|
| 69 | | # if it is padded with leading white space. |
|---|
| 70 | | comments << ' ' + $1 if line =~ /^[\s[:punct:]]*(.*?)(\s+[\s[:punct:]]*)*$/ |
|---|
| | 68 | # Strip leading punctuation. |
|---|
| | 69 | comments << ' ' + $1 if line =~ /^[\s[:punct:]]*(.*?)$/ |
|---|
| 71 | 70 | end |
|---|
| 72 | 71 | end |
|---|