Review main Abandoned

58533[BUGFIX] Avoid scanning entire haystack in begins/ends-with

Claus Due CR 0 V 0 Easy +3 −8 updated 01/15/20, 12:00

Commit message

Problem: functions are intended to test if a string starts
or ends with another string, but achieves its goal by
scanning the entire haystack and comparing the position
of any possibly found match. This is much less efficient
than using strcmp.

The resulting function is a bit more naive but many times
faster for large haystacks where needle does not occur.

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1