Skip to content

[FIX]: Router does not cache compiled regex #137

Description

@NikSimDev

Version

v0.1.5

Severity

Minor (annoyance)

Problem Description

// Each match() recompiles the regex
if (route.match(target, params)) {  // std::regex(pattern) every time?

Solution:

class Route {
    std::regex pattern_;  // Compiled once
};

Verification

  • I have searched for existing issues
  • I am using the latest version
  • I have provided a minimal reproduction

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions