Changeset 841 for trunk/tools
- Timestamp:
- 10/12/11 04:30:03 (8 months ago)
- Files:
-
- trunk/tools/tools/ctfe.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/tools/ctfe.d
r840 r841 41 41 42 42 int ctFind(string text, string match) { 43 if (match.length > text.length) return -1; 44 for (int i = 0; i <= text.length - match.length; ++i) { 45 if (text[i .. i+match.length] == match) return i; 43 int tl = text.length, ml = match.length, dl = tl - ml; 44 if (ml > tl) return -1; 45 for (int i = 0; i <= dl; ++i) { 46 if (text[i .. i+ml] == match) return i; 46 47 } 47 48 return -1;
