Changeset 391 for python/trunk/Objects/stringlib/count.h
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Objects/stringlib/count.h
r2 r391 10 10 Py_LOCAL_INLINE(Py_ssize_t) 11 11 stringlib_count(const STRINGLIB_CHAR* str, Py_ssize_t str_len, 12 const STRINGLIB_CHAR* sub, Py_ssize_t sub_len) 12 const STRINGLIB_CHAR* sub, Py_ssize_t sub_len, 13 Py_ssize_t maxcount) 13 14 { 14 15 Py_ssize_t count; … … 17 18 return 0; /* start > len(str) */ 18 19 if (sub_len == 0) 19 return str_len + 1;20 return (str_len < maxcount) ? str_len + 1 : maxcount; 20 21 21 count = fastsearch(str, str_len, sub, sub_len, FAST_COUNT);22 count = fastsearch(str, str_len, sub, sub_len, maxcount, FAST_COUNT); 22 23 23 24 if (count < 0) 24 count =0; /* no match */25 return 0; /* no match */ 25 26 26 27 return count; … … 28 29 29 30 #endif 30 31 /*32 Local variables:33 c-basic-offset: 434 indent-tabs-mode: nil35 End:36 */
Note:
See TracChangeset
for help on using the changeset viewer.