Skip to content

cache the regexp #85

Open
Open

Description

@kibitan

here it's dynamically making the regexp

https://github.com/kibitan/masking/blob/main/lib/masking/insert_statement.rb#L69-L71

    def values_regexp
      @values_regexp ||= /^\(?#{([VALUE_REGEXP] * columns.count).join(?,)}\)?$/
    end

but it will be same regexp if it has same count of columns, let's cache it and reused it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions