mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-31 17:03:30 +02:00
Enhancement - caseless find
- Fixed bug that didn't properly consider the starting offset in find.
This commit is contained in:
parent
06ecef76d3
commit
9cab749016
1 changed files with 3 additions and 3 deletions
|
@ -536,12 +536,12 @@ std::string::size_type find (
|
|||
return 0;
|
||||
|
||||
// Handle bad begin.
|
||||
if (begin >= len)
|
||||
if (begin >= text.length ())
|
||||
return std::string::npos;
|
||||
|
||||
// Evaluate these once, for performance reasons.
|
||||
const char* t = text.c_str ();
|
||||
const char* start = t + begin;
|
||||
const char* start = text.c_str ();
|
||||
const char* t = start + begin;
|
||||
const char* end = start + text.size ();
|
||||
|
||||
for (; t < end - len; ++t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue