Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32795 Additional optimizations to replaceString #19239

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Oct 25, 2024

  1. HPCC-32795 Additional optimizations to replaceString

    - Does nothing if no search string is supplied or if it is larger than the source string
    - Compare directly if search and source string are equal in length
    
    Signed-off-by: Jack Del Vecchio <[email protected]>
    jackdelv committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    6f71021 View commit details
    Browse the repository at this point in the history
  2. Directly copy newStr to buffer in special case.

    - Add unit tests for special case
    jackdelv committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    4bb7a82 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. Fix memory corruption issue

    - Add ensureCapacity(newlen)
    jackdelv committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    98315c6 View commit details
    Browse the repository at this point in the history
  2. Optimize for case where no matches are found

    - Add additional parameter to replaceString that returns whether a match was found
    - Wait to allocate memory until a match is made rather than at the beginning of the search
    - Avoid copying source into result if source wasn't changed
    jackdelv committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    19984dd View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2024

  1. Optimize for case where target is less than or equal to source string.

    - Move the target into the source rather than copy and skip allocating.
    - Add tests for each case of target length
    jackdelv committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    b6dc378 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Change return type of replaceString function

    - Returns a bool indicating whether a match was made
    - Accepts a parameter to force a copy even if no match was found
    jackdelv committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    e3364e7 View commit details
    Browse the repository at this point in the history
  2. Remove extra line

    jackdelv committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    b57c932 View commit details
    Browse the repository at this point in the history
  3. Remove duplicate code.

    jackdelv committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    45800b0 View commit details
    Browse the repository at this point in the history